Commit 03ad2d501e7189245bf6bf9dfc2a30511dd50602
Committed by
John Stultz
1 parent
e08f6d4131
Exists in
master
and in
4 other branches
rtc: vt8500: Fix build error & cleanup rtc_class_ops->update_irq_enable()
Now that the generic code handles UIE mode irqs via periodic alarm interrupts, no one calls the rtc_class_ops->update_irq_enable() method anymore. Further the rtc_class_ops doesn't have a update_irq_enable element anymore, so this causes a build error. This patch removes the driver hooks and implementations of update_irq_enable and the associated setup. [wsa: updated commit-message and removed update_irq_enable-function, too] [jstultz: improve commit message, clarifying build issue] Signed-off-by: Alexey Charkov <alchark@gmail.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
Showing 1 changed file with 3 additions and 42 deletions Side-by-side Diff
drivers/rtc/rtc-vt8500.c
... | ... | @@ -78,7 +78,6 @@ |
78 | 78 | void __iomem *regbase; |
79 | 79 | struct resource *res; |
80 | 80 | int irq_alarm; |
81 | - int irq_hz; | |
82 | 81 | struct rtc_device *rtc; |
83 | 82 | spinlock_t lock; /* Protects this structure */ |
84 | 83 | }; |
... | ... | @@ -100,10 +99,6 @@ |
100 | 99 | if (isr & 1) |
101 | 100 | events |= RTC_AF | RTC_IRQF; |
102 | 101 | |
103 | - /* Only second/minute interrupts are supported */ | |
104 | - if (isr & 2) | |
105 | - events |= RTC_UF | RTC_IRQF; | |
106 | - | |
107 | 102 | rtc_update_irq(vt8500_rtc->rtc, 1, events); |
108 | 103 | |
109 | 104 | return IRQ_HANDLED; |
110 | 105 | |
... | ... | @@ -199,27 +194,12 @@ |
199 | 194 | return 0; |
200 | 195 | } |
201 | 196 | |
202 | -static int vt8500_update_irq_enable(struct device *dev, unsigned int enabled) | |
203 | -{ | |
204 | - struct vt8500_rtc *vt8500_rtc = dev_get_drvdata(dev); | |
205 | - unsigned long tmp = readl(vt8500_rtc->regbase + VT8500_RTC_CR); | |
206 | - | |
207 | - if (enabled) | |
208 | - tmp |= VT8500_RTC_CR_SM_SEC | VT8500_RTC_CR_SM_ENABLE; | |
209 | - else | |
210 | - tmp &= ~VT8500_RTC_CR_SM_ENABLE; | |
211 | - | |
212 | - writel(tmp, vt8500_rtc->regbase + VT8500_RTC_CR); | |
213 | - return 0; | |
214 | -} | |
215 | - | |
216 | 197 | static const struct rtc_class_ops vt8500_rtc_ops = { |
217 | 198 | .read_time = vt8500_rtc_read_time, |
218 | 199 | .set_time = vt8500_rtc_set_time, |
219 | 200 | .read_alarm = vt8500_rtc_read_alarm, |
220 | 201 | .set_alarm = vt8500_rtc_set_alarm, |
221 | 202 | .alarm_irq_enable = vt8500_alarm_irq_enable, |
222 | - .update_irq_enable = vt8500_update_irq_enable, | |
223 | 203 | }; |
224 | 204 | |
225 | 205 | static int __devinit vt8500_rtc_probe(struct platform_device *pdev) |
... | ... | @@ -248,13 +228,6 @@ |
248 | 228 | goto err_free; |
249 | 229 | } |
250 | 230 | |
251 | - vt8500_rtc->irq_hz = platform_get_irq(pdev, 1); | |
252 | - if (vt8500_rtc->irq_hz < 0) { | |
253 | - dev_err(&pdev->dev, "No 1Hz IRQ resource defined\n"); | |
254 | - ret = -ENXIO; | |
255 | - goto err_free; | |
256 | - } | |
257 | - | |
258 | 231 | vt8500_rtc->res = request_mem_region(vt8500_rtc->res->start, |
259 | 232 | resource_size(vt8500_rtc->res), |
260 | 233 | "vt8500-rtc"); |
... | ... | @@ -272,9 +245,8 @@ |
272 | 245 | goto err_release; |
273 | 246 | } |
274 | 247 | |
275 | - /* Enable the second/minute interrupt generation and enable RTC */ | |
276 | - writel(VT8500_RTC_CR_ENABLE | VT8500_RTC_CR_24H | |
277 | - | VT8500_RTC_CR_SM_ENABLE | VT8500_RTC_CR_SM_SEC, | |
248 | + /* Enable RTC and set it to 24-hour mode */ | |
249 | + writel(VT8500_RTC_CR_ENABLE | VT8500_RTC_CR_24H, | |
278 | 250 | vt8500_rtc->regbase + VT8500_RTC_CR); |
279 | 251 | |
280 | 252 | vt8500_rtc->rtc = rtc_device_register("vt8500-rtc", &pdev->dev, |
281 | 253 | |
282 | 254 | |
... | ... | @@ -286,26 +258,16 @@ |
286 | 258 | goto err_unmap; |
287 | 259 | } |
288 | 260 | |
289 | - ret = request_irq(vt8500_rtc->irq_hz, vt8500_rtc_irq, 0, | |
290 | - "rtc 1Hz", vt8500_rtc); | |
291 | - if (ret < 0) { | |
292 | - dev_err(&pdev->dev, "can't get irq %i, err %d\n", | |
293 | - vt8500_rtc->irq_hz, ret); | |
294 | - goto err_unreg; | |
295 | - } | |
296 | - | |
297 | 261 | ret = request_irq(vt8500_rtc->irq_alarm, vt8500_rtc_irq, 0, |
298 | 262 | "rtc alarm", vt8500_rtc); |
299 | 263 | if (ret < 0) { |
300 | 264 | dev_err(&pdev->dev, "can't get irq %i, err %d\n", |
301 | 265 | vt8500_rtc->irq_alarm, ret); |
302 | - goto err_free_hz; | |
266 | + goto err_unreg; | |
303 | 267 | } |
304 | 268 | |
305 | 269 | return 0; |
306 | 270 | |
307 | -err_free_hz: | |
308 | - free_irq(vt8500_rtc->irq_hz, vt8500_rtc); | |
309 | 271 | err_unreg: |
310 | 272 | rtc_device_unregister(vt8500_rtc->rtc); |
311 | 273 | err_unmap: |
... | ... | @@ -323,7 +285,6 @@ |
323 | 285 | struct vt8500_rtc *vt8500_rtc = platform_get_drvdata(pdev); |
324 | 286 | |
325 | 287 | free_irq(vt8500_rtc->irq_alarm, vt8500_rtc); |
326 | - free_irq(vt8500_rtc->irq_hz, vt8500_rtc); | |
327 | 288 | |
328 | 289 | rtc_device_unregister(vt8500_rtc->rtc); |
329 | 290 |