diff options
author | Ben Dooks <ben.dooks@codethink.co.uk> | 2016-06-07 07:53:07 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2016-07-17 15:00:44 -0400 |
commit | b99c87740541f04cec056978452d7913da6ac9a5 (patch) | |
tree | 3213849126f0b56f60082a5f6bd685380342dac1 | |
parent | a3e376d26ace6d823f7aa4c63476e7089a6196df (diff) |
watchdog: sirf: fix __iomem * warnings
Fix the following warnings from sparse due to casting to/from an __iomem
annotated variable:
drivers/watchdog/sirfsoc_wdt.c:48:18: warning: incorrect type in assignment (different address spaces)
drivers/watchdog/sirfsoc_wdt.c:48:18: expected void [noderef] <asn:2>*wdt_base
drivers/watchdog/sirfsoc_wdt.c:48:18: got void *
drivers/watchdog/sirfsoc_wdt.c:64:18: warning: incorrect type in assignment (different address spaces)
drivers/watchdog/sirfsoc_wdt.c:64:18: expected void [noderef] <asn:2>*wdt_base
drivers/watchdog/sirfsoc_wdt.c:64:18: got void *
drivers/watchdog/sirfsoc_wdt.c:82:54: warning: incorrect type in initializer (different address spaces)
drivers/watchdog/sirfsoc_wdt.c:82:54: expected void [noderef] <asn:2>*wdt_base
drivers/watchdog/sirfsoc_wdt.c:82:54: got void *
drivers/watchdog/sirfsoc_wdt.c:99:54: warning: incorrect type in initializer (different address spaces)
drivers/watchdog/sirfsoc_wdt.c:99:54: expected void [noderef] <asn:2>*wdt_base
drivers/watchdog/sirfsoc_wdt.c:99:54: got void *
drivers/watchdog/sirfsoc_wdt.c:153:44: warning: incorrect type in argument 2 (different address spaces)
drivers/watchdog/sirfsoc_wdt.c:153:44: expected void *data
drivers/watchdog/sirfsoc_wdt.c:153:44: got void [noderef] <asn:2>*[assigned] base
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
-rw-r--r-- | drivers/watchdog/sirfsoc_wdt.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c index d0578ab2e636..3050a0031479 100644 --- a/drivers/watchdog/sirfsoc_wdt.c +++ b/drivers/watchdog/sirfsoc_wdt.c | |||
@@ -39,13 +39,18 @@ MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)"); | |||
39 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" | 39 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" |
40 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | 40 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
41 | 41 | ||
42 | static void __iomem *sirfsoc_wdt_base(struct watchdog_device *wdd) | ||
43 | { | ||
44 | return (void __iomem __force *)watchdog_get_drvdata(wdd); | ||
45 | } | ||
46 | |||
42 | static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd) | 47 | static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd) |
43 | { | 48 | { |
44 | u32 counter, match; | 49 | u32 counter, match; |
45 | void __iomem *wdt_base; | 50 | void __iomem *wdt_base; |
46 | int time_left; | 51 | int time_left; |
47 | 52 | ||
48 | wdt_base = watchdog_get_drvdata(wdd); | 53 | wdt_base = sirfsoc_wdt_base(wdd); |
49 | counter = readl(wdt_base + SIRFSOC_TIMER_COUNTER_LO); | 54 | counter = readl(wdt_base + SIRFSOC_TIMER_COUNTER_LO); |
50 | match = readl(wdt_base + | 55 | match = readl(wdt_base + |
51 | SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2)); | 56 | SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2)); |
@@ -61,7 +66,7 @@ static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd) | |||
61 | void __iomem *wdt_base; | 66 | void __iomem *wdt_base; |
62 | 67 | ||
63 | timeout_ticks = wdd->timeout * CLOCK_FREQ; | 68 | timeout_ticks = wdd->timeout * CLOCK_FREQ; |
64 | wdt_base = watchdog_get_drvdata(wdd); | 69 | wdt_base = sirfsoc_wdt_base(wdd); |
65 | 70 | ||
66 | /* Enable the latch before reading the LATCH_LO register */ | 71 | /* Enable the latch before reading the LATCH_LO register */ |
67 | writel(1, wdt_base + SIRFSOC_TIMER_LATCH); | 72 | writel(1, wdt_base + SIRFSOC_TIMER_LATCH); |
@@ -79,7 +84,7 @@ static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd) | |||
79 | 84 | ||
80 | static int sirfsoc_wdt_enable(struct watchdog_device *wdd) | 85 | static int sirfsoc_wdt_enable(struct watchdog_device *wdd) |
81 | { | 86 | { |
82 | void __iomem *wdt_base = watchdog_get_drvdata(wdd); | 87 | void __iomem *wdt_base = sirfsoc_wdt_base(wdd); |
83 | sirfsoc_wdt_updatetimeout(wdd); | 88 | sirfsoc_wdt_updatetimeout(wdd); |
84 | 89 | ||
85 | /* | 90 | /* |
@@ -96,7 +101,7 @@ static int sirfsoc_wdt_enable(struct watchdog_device *wdd) | |||
96 | 101 | ||
97 | static int sirfsoc_wdt_disable(struct watchdog_device *wdd) | 102 | static int sirfsoc_wdt_disable(struct watchdog_device *wdd) |
98 | { | 103 | { |
99 | void __iomem *wdt_base = watchdog_get_drvdata(wdd); | 104 | void __iomem *wdt_base = sirfsoc_wdt_base(wdd); |
100 | 105 | ||
101 | writel(0, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN); | 106 | writel(0, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN); |
102 | writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN) | 107 | writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN) |
@@ -150,7 +155,7 @@ static int sirfsoc_wdt_probe(struct platform_device *pdev) | |||
150 | if (IS_ERR(base)) | 155 | if (IS_ERR(base)) |
151 | return PTR_ERR(base); | 156 | return PTR_ERR(base); |
152 | 157 | ||
153 | watchdog_set_drvdata(&sirfsoc_wdd, base); | 158 | watchdog_set_drvdata(&sirfsoc_wdd, (__force void *)base); |
154 | 159 | ||
155 | watchdog_init_timeout(&sirfsoc_wdd, timeout, &pdev->dev); | 160 | watchdog_init_timeout(&sirfsoc_wdd, timeout, &pdev->dev); |
156 | watchdog_set_nowayout(&sirfsoc_wdd, nowayout); | 161 | watchdog_set_nowayout(&sirfsoc_wdd, nowayout); |