summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/nvmem.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-02-12 23:47:17 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-02-14 20:58:13 +0100
commit2cc8212198820487ec3fdcc7b98133701fc9dfc3 (patch)
treee4e81b3f8b537aa7f6aa4960dae86bbe04f7dc06 /drivers/rtc/nvmem.c
parent4cce9d3988ae33eb53742d9648ecc59046196e6f (diff)
downloadtalos-obmc-linux-2cc8212198820487ec3fdcc7b98133701fc9dfc3.tar.gz
talos-obmc-linux-2cc8212198820487ec3fdcc7b98133701fc9dfc3.zip
rtc: nvmem: return error values
In case of error, make rtc_nvmem_register() able to return an error value to its caller. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/nvmem.c')
-rw-r--r--drivers/rtc/nvmem.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/rtc/nvmem.c b/drivers/rtc/nvmem.c
index 0a3522bcdd25..293df6db7c42 100644
--- a/drivers/rtc/nvmem.c
+++ b/drivers/rtc/nvmem.c
@@ -84,21 +84,23 @@ static void rtc_nvram_unregister(struct rtc_device *rtc)
/*
* New ABI, uses nvmem
*/
-void rtc_nvmem_register(struct rtc_device *rtc,
- struct nvmem_config *nvmem_config)
+int rtc_nvmem_register(struct rtc_device *rtc,
+ struct nvmem_config *nvmem_config)
{
if (!nvmem_config)
- return;
+ return -ENODEV;
nvmem_config->dev = &rtc->dev;
nvmem_config->owner = rtc->owner;
rtc->nvmem = nvmem_register(nvmem_config);
if (IS_ERR_OR_NULL(rtc->nvmem))
- return;
+ return PTR_ERR(rtc->nvmem);
/* Register the old ABI */
if (rtc->nvram_old_abi)
rtc_nvram_register(rtc, nvmem_config->size);
+
+ return 0;
}
void rtc_nvmem_unregister(struct rtc_device *rtc)
OpenPOWER on IntegriCloud