diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-14 10:07:08 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-14 10:07:08 +0200 |
commit | 05fa34dcdb34d2a496ef89d8f361ca697643edec (patch) | |
tree | 1d5bddce044e2646776c5a315eec4211be3f3410 /drivers/misc/eeprom | |
parent | Merge tag 'fsi-for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/joe... (diff) | |
parent | Linux 5.9-rc5 (diff) | |
download | linux-05fa34dcdb34d2a496ef89d8f361ca697643edec.tar.xz linux-05fa34dcdb34d2a496ef89d8f361ca697643edec.zip |
Merge 5.9-rc5 into char-misc-next
We want the char/misc fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/eeprom')
-rw-r--r-- | drivers/misc/eeprom/at24.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index 2591c21b2b5d..26a23abc053d 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c @@ -692,10 +692,6 @@ static int at24_probe(struct i2c_client *client) nvmem_config.word_size = 1; nvmem_config.size = byte_len; - at24->nvmem = devm_nvmem_register(dev, &nvmem_config); - if (IS_ERR(at24->nvmem)) - return PTR_ERR(at24->nvmem); - i2c_set_clientdata(client, at24); err = regulator_enable(at24->vcc_reg); @@ -708,6 +704,13 @@ static int at24_probe(struct i2c_client *client) pm_runtime_set_active(dev); pm_runtime_enable(dev); + at24->nvmem = devm_nvmem_register(dev, &nvmem_config); + if (IS_ERR(at24->nvmem)) { + pm_runtime_disable(dev); + regulator_disable(at24->vcc_reg); + return PTR_ERR(at24->nvmem); + } + /* * Perform a one-byte test read to verify that the * chip is functional. |