From: Madhusudhan Chikkature Date: Thu, 25 Sep 2008 06:56:17 +0000 (+0530) Subject: HDQ driver: use ioremap for HDQ base X-Git-Tag: v2.6.27-omap1~72 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=d98ff22b9098cbb2514cd486841cf5f1f124276c;p=linux-2.6-omap-h63xx.git HDQ driver: use ioremap for HDQ base This patch provides the ioremap related changes to the driver. Signed-off-by: Madhusudhan Chikkature Acked-by: Evgeniy Polyakov Acked-by: Felipe Balbi Signed-off-by: Tony Lindgren --- diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c index 29137a13881..9a2f3d08bec 100644 --- a/drivers/w1/masters/omap_hdq.c +++ b/drivers/w1/masters/omap_hdq.c @@ -54,7 +54,7 @@ static int w1_id; struct hdq_data { struct device *dev; - resource_size_t hdq_base; + void __iomem *hdq_base; struct semaphore hdq_semlock; int hdq_usecount; struct clk *hdq_ick; @@ -99,12 +99,12 @@ static struct w1_bus_master omap_w1_master = { */ static inline u8 hdq_reg_in(struct hdq_data *hdq_data, u32 offset) { - return omap_readb(hdq_data->hdq_base + offset); + return __raw_readb(hdq_data->hdq_base + offset); } static inline u8 hdq_reg_out(struct hdq_data *hdq_data, u32 offset, u8 val) { - omap_writeb(val, hdq_data->hdq_base + offset); + __raw_writeb(val, hdq_data->hdq_base + offset); return val; } @@ -112,9 +112,9 @@ static inline u8 hdq_reg_out(struct hdq_data *hdq_data, u32 offset, u8 val) static inline u8 hdq_reg_merge(struct hdq_data *hdq_data, u32 offset, u8 val, u8 mask) { - u8 new_val = (omap_readb(hdq_data->hdq_base + offset) & ~mask) + u8 new_val = (__raw_readb(hdq_data->hdq_base + offset) & ~mask) | (val & mask); - omap_writeb(new_val, hdq_data->hdq_base + offset); + __raw_writeb(new_val, hdq_data->hdq_base + offset); return new_val; } @@ -589,7 +589,12 @@ static int __init omap_hdq_probe(struct platform_device *pdev) goto err_resource; } - hdq_data->hdq_base = res->start; + hdq_data->hdq_base = ioremap(res->start, SZ_4K); + if (!hdq_data->hdq_base) { + dev_dbg(&pdev->dev, "ioremap failed\n"); + ret = -EINVAL; + goto err_ioremap; + } /* get interface & functional clock objects */ hdq_data->hdq_ick = clk_get(&pdev->dev, "hdq_ick"); @@ -668,8 +673,9 @@ err_ick: clk_put(hdq_data->hdq_fck); err_clk: - hdq_data->hdq_base = NULL; + iounmap(hdq_data->hdq_base); +err_ioremap: err_resource: platform_set_drvdata(pdev, NULL); kfree(hdq_data); @@ -695,6 +701,7 @@ static int omap_hdq_remove(struct platform_device *pdev) clk_put(hdq_data->hdq_fck); free_irq(INT_24XX_HDQ_IRQ, hdq_data); platform_set_drvdata(pdev, NULL); + iounmap(hdq_data->hdq_base); kfree(hdq_data); return 0;