mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00:00
rtc: fix potential race condition
RTC drivers must not return an error after device registration. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Reported-by: Ales Novak <alnovak@suse.cz> Cc: Alexander Shiyan <shc_work@mail.ru> Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: Jiri Kosina <jkosina@suse.cz> Cc: Srikanth Srinivasan <srikanth.srinivasan@freescale.com> Cc: Lee Jones <lee.jones@linaro.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
a68b310809
commit
4071ea25cc
9 changed files with 70 additions and 65 deletions
|
@ -756,19 +756,17 @@ static int ds1305_probe(struct spi_device *spi)
|
|||
status = devm_request_irq(&spi->dev, spi->irq, ds1305_irq,
|
||||
0, dev_name(&ds1305->rtc->dev), ds1305);
|
||||
if (status < 0) {
|
||||
dev_dbg(&spi->dev, "request_irq %d --> %d\n",
|
||||
dev_err(&spi->dev, "request_irq %d --> %d\n",
|
||||
spi->irq, status);
|
||||
return status;
|
||||
} else {
|
||||
device_set_wakeup_capable(&spi->dev, 1);
|
||||
}
|
||||
|
||||
device_set_wakeup_capable(&spi->dev, 1);
|
||||
}
|
||||
|
||||
/* export NVRAM */
|
||||
status = sysfs_create_bin_file(&spi->dev.kobj, &nvram);
|
||||
if (status < 0) {
|
||||
dev_dbg(&spi->dev, "register nvram --> %d\n", status);
|
||||
return status;
|
||||
dev_err(&spi->dev, "register nvram --> %d\n", status);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue