提交 ab3ea36e 编写于 作者: A Alexandre Belloni

rtc: nvmem: disallow registering nvmem more than once

Make rtc_nvmem_register return -EBUSY when an nvmem is already registered
for that RTC.
Signed-off-by: NAlexandre Belloni <alexandre.belloni@bootlin.com>
上级 2cc82121
......@@ -87,6 +87,9 @@ static void rtc_nvram_unregister(struct rtc_device *rtc)
int rtc_nvmem_register(struct rtc_device *rtc,
struct nvmem_config *nvmem_config)
{
if (!IS_ERR_OR_NULL(rtc->nvmem))
return -EBUSY;
if (!nvmem_config)
return -ENODEV;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册