mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
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: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
2cc8212198
commit
ab3ea36eda
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue