diff options
| author | Alessandro Zummo <[email protected]> | 2014-04-03 21:49:36 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2014-04-03 23:21:16 +0000 |
| commit | 4071ea25cc08d41002746cca2d69ac700d67a2ac (patch) | |
| tree | 43cf44f8265b885c8c1e4e81f0ced5c6babb53c7 /drivers/rtc/rtc-ds1305.c | |
| parent | init/do_mounts.c: fix comment error (diff) | |
| download | kernel-4071ea25cc08d41002746cca2d69ac700d67a2ac.tar.gz kernel-4071ea25cc08d41002746cca2d69ac700d67a2ac.zip | |
rtc: fix potential race condition
RTC drivers must not return an error after device registration.
[[email protected]: coding-style fixes]
Signed-off-by: Alessandro Zummo <[email protected]>
Reported-by: Ales Novak <[email protected]>
Cc: Alexander Shiyan <[email protected]>
Cc: Atsushi Nemoto <[email protected]>
Cc: Jiri Kosina <[email protected]>
Cc: Srikanth Srinivasan <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/rtc/rtc-ds1305.c')
| -rw-r--r-- | drivers/rtc/rtc-ds1305.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c index 2dd586a19b59..129add77065d 100644 --- a/drivers/rtc/rtc-ds1305.c +++ b/drivers/rtc/rtc-ds1305.c @@ -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; |
