aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/rtc/rtc-bfin.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-06-06 14:36:07 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 16:08:08 -0700
commit778575ff30294adea9fc1d935dc1364e25f8f138 (patch)
tree063655b218ddf5a81646ab32b32be5ed34c240a3 /drivers/rtc/rtc-bfin.c
parentdrivers/rtc/rtc-omap.c: add support for enabling 32khz clock (diff)
downloadwireguard-linux-778575ff30294adea9fc1d935dc1364e25f8f138.tar.xz
wireguard-linux-778575ff30294adea9fc1d935dc1364e25f8f138.zip
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/rtc-bfin.c')
-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)
{
struct bfin_rtc *rtc;
struct device *dev = &pdev->dev;
- int ret = 0;
+ int ret;
unsigned long timeout = jiffies + HZ;
dev_dbg_stamp(dev);
@@ -361,16 +361,17 @@ static int bfin_rtc_probe(struct platform_device *pdev)
/* Register our RTC with the RTC framework */
rtc->rtc_dev = devm_rtc_device_register(dev, pdev->name, &bfin_rtc_ops,
THIS_MODULE);
- if (unlikely(IS_ERR(rtc->rtc_dev))) {
- ret = PTR_ERR(rtc->rtc_dev);
- goto err;
- }
+ if (unlikely(IS_ERR(rtc->rtc_dev)))
+ return PTR_ERR(rtc->rtc_dev);
/* Grab the IRQ and init the hardware */
ret = devm_request_irq(dev, IRQ_RTC, bfin_rtc_interrupt, 0,
pdev->name, dev);
if (unlikely(ret))
- goto err;
+ dev_err(&pdev->dev,
+ "unable to request IRQ; alarm won't work, "
+ "and writes will be delayed\n");
+
/* sometimes the bootloader touched things, but the write complete was not
* enabled, so let's just do a quick timeout here since the IRQ will not fire ...
*/
@@ -381,9 +382,6 @@ static int bfin_rtc_probe(struct platform_device *pdev)
bfin_write_RTC_SWCNT(0);
return 0;
-
-err:
- return ret;
}
static int bfin_rtc_remove(struct platform_device *pdev)