Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mike Frysinger and committed by
Linus Torvalds
778575ff cd914bba

+7 -9
+7 -9
drivers/rtc/rtc-bfin.c
··· 346 346 { 347 347 struct bfin_rtc *rtc; 348 348 struct device *dev = &pdev->dev; 349 - int ret = 0; 349 + int ret; 350 350 unsigned long timeout = jiffies + HZ; 351 351 352 352 dev_dbg_stamp(dev); ··· 361 361 /* Register our RTC with the RTC framework */ 362 362 rtc->rtc_dev = devm_rtc_device_register(dev, pdev->name, &bfin_rtc_ops, 363 363 THIS_MODULE); 364 - if (unlikely(IS_ERR(rtc->rtc_dev))) { 365 - ret = PTR_ERR(rtc->rtc_dev); 366 - goto err; 367 - } 364 + if (unlikely(IS_ERR(rtc->rtc_dev))) 365 + return PTR_ERR(rtc->rtc_dev); 368 366 369 367 /* Grab the IRQ and init the hardware */ 370 368 ret = devm_request_irq(dev, IRQ_RTC, bfin_rtc_interrupt, 0, 371 369 pdev->name, dev); 372 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 375 /* sometimes the bootloader touched things, but the write complete was not 375 376 * enabled, so let's just do a quick timeout here since the IRQ will not fire ... 376 377 */ ··· 382 381 bfin_write_RTC_SWCNT(0); 383 382 384 383 return 0; 385 - 386 - err: 387 - return ret; 388 384 } 389 385 390 386 static int bfin_rtc_remove(struct platform_device *pdev)