aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-06-06 17:36:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 19:08:08 -0400
commit778575ff30294adea9fc1d935dc1364e25f8f138 (patch)
tree063655b218ddf5a81646ab32b32be5ed34c240a3 /drivers/rtc
parentcd914bba03d8a2ba30bf7385c5e2da9ac30f574f (diff)
drivers/rtc/rtc-bfin.c: do not abort when requesting irq fails
The RTC framework does not let you return an error once a call to devm_rtc_device_register has succeeded. Avoid doing that when the IRQ request fails as we can still support reading/writing the clock without the IRQ. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reported-by: Ales Novak <alnovak@suse.cz> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-bfin.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c
index 0c53f452849d..fe4bdb06a55a 100644
--- a/drivers/rtc/rtc-bfin.c
+++ b/drivers/rtc/rtc-bfin.c
@@ -346,7 +346,7 @@ static int bfin_rtc_probe(struct platform_device *pdev)
346{ 346{
347 struct bfin_rtc *rtc; 347 struct bfin_rtc *rtc;
348 struct device *dev = &pdev->dev; 348 struct device *dev = &pdev->dev;
349 int ret = 0; 349 int ret;
350 unsigned long timeout = jiffies + HZ; 350 unsigned long timeout = jiffies + HZ;
351 351
352 dev_dbg_stamp(dev); 352 dev_dbg_stamp(dev);
@@ -361,16 +361,17 @@ static int bfin_rtc_probe(struct platform_device *pdev)
361 /* Register our RTC with the RTC framework */ 361 /* Register our RTC with the RTC framework */
362 rtc->rtc_dev = devm_rtc_device_register(dev, pdev->name, &bfin_rtc_ops, 362 rtc->rtc_dev = devm_rtc_device_register(dev, pdev->name, &bfin_rtc_ops,
363 THIS_MODULE); 363 THIS_MODULE);
364 if (unlikely(IS_ERR(rtc->rtc_dev))) { 364 if (unlikely(IS_ERR(rtc->rtc_dev)))
365 ret = PTR_ERR(rtc->rtc_dev); 365 return PTR_ERR(rtc->rtc_dev);
366 goto err;
367 }
368 366
369 /* Grab the IRQ and init the hardware */ 367 /* Grab the IRQ and init the hardware */
370 ret = devm_request_irq(dev, IRQ_RTC, bfin_rtc_interrupt, 0, 368 ret = devm_request_irq(dev, IRQ_RTC, bfin_rtc_interrupt, 0,
371 pdev->name, dev); 369 pdev->name, dev);
372 if (unlikely(ret)) 370 if (unlikely(ret))
373 goto err; 371 dev_err(&pdev->dev,
372 "unable to request IRQ; alarm won't work, "
373 "and writes will be delayed\n");
374
374 /* sometimes the bootloader touched things, but the write complete was not 375 /* sometimes the bootloader touched things, but the write complete was not
375 * enabled, so let's just do a quick timeout here since the IRQ will not fire ... 376 * enabled, so let's just do a quick timeout here since the IRQ will not fire ...
376 */ 377 */
@@ -381,9 +382,6 @@ static int bfin_rtc_probe(struct platform_device *pdev)
381 bfin_write_RTC_SWCNT(0); 382 bfin_write_RTC_SWCNT(0);
382 383
383 return 0; 384 return 0;
384
385err:
386 return ret;
387} 385}
388 386
389static int bfin_rtc_remove(struct platform_device *pdev) 387static int bfin_rtc_remove(struct platform_device *pdev)