]> git.baikalelectronics.ru Git - kernel.git/commit
misc: eeprom: at24: register nvmem only after eeprom is ready to use
authorVadym Kochan <vadym.kochan@plvision.eu>
Mon, 31 Aug 2020 01:55:39 +0000 (04:55 +0300)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 1 Sep 2020 07:49:55 +0000 (09:49 +0200)
commit7a75b1814324af82c718a149e4f5810030af7f07
tree729a9d31b216fab6d1c06eaa97387a2e5da4477c
parentdd44bddf04c5fd83529b139fbfac0a5372c1a87d
misc: eeprom: at24: register nvmem only after eeprom is ready to use

During nvmem_register() the nvmem core sends notifications when:

    - cell added
    - nvmem added

and during these notifications some callback func may access the nvmem
device, which will fail in case of at24 eeprom because regulator and pm
are enabled after nvmem_register().

Fixes: 47f4d15e3435 ("misc: eeprom: at24: support pm_runtime control")
Fixes: fca7d42b4540 ("eeprom: at24: drop unnecessary label")
Cc: stable@vger.kernel.org
Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/misc/eeprom/at24.c