* [PATCH] misc: microchip: pci1xxxx: Fix return value of nvmem callbacks
@ 2024-06-12 7:00 Joy Chakraborty
2024-06-12 7:41 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Joy Chakraborty @ 2024-06-12 7:00 UTC (permalink / raw)
To: Vaibhaav Ram T . L, Greg Kroah-Hartman, Kumaravel Thiagarajan,
Tharun Kumar P, Srinivas Kandagatla, Dan Carpenter
Cc: linux-gpio, linux-kernel, Joy Chakraborty, stable
Read/write callbacks registered with nvmem core expect 0 to be returned
on success and a negative value to be returned on failure.
Currently pci1xxxx_otp_read()/pci1xxxx_otp_write() and
pci1xxxx_eeprom_read()/pci1xxxx_eeprom_write() return the number of
bytes read/written on success.
Fix to return 0 on success.
Fixes: 9ab5465349c0 ("misc: microchip: pci1xxxx: Add support to read and write into PCI1XXXX EEPROM via NVMEM sysfs")
Fixes: 0969001569e4 ("misc: microchip: pci1xxxx: Add support to read and write into PCI1XXXX OTP via NVMEM sysfs")
Cc: stable@vger.kernel.org
Signed-off-by: Joy Chakraborty <joychakr@google.com>
---
drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c
index 16695cb5e69c..7c3d8bedf90b 100644
--- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c
+++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c
@@ -153,7 +153,6 @@ static int pci1xxxx_eeprom_read(void *priv_t, unsigned int off,
buf[byte] = readl(rb + MMAP_EEPROM_OFFSET(EEPROM_DATA_REG));
}
- ret = byte;
error:
release_sys_lock(priv);
return ret;
@@ -197,7 +196,6 @@ static int pci1xxxx_eeprom_write(void *priv_t, unsigned int off,
goto error;
}
}
- ret = byte;
error:
release_sys_lock(priv);
return ret;
@@ -258,7 +256,6 @@ static int pci1xxxx_otp_read(void *priv_t, unsigned int off,
buf[byte] = readl(rb + MMAP_OTP_OFFSET(OTP_RD_DATA_OFFSET));
}
- ret = byte;
error:
release_sys_lock(priv);
return ret;
@@ -315,7 +312,6 @@ static int pci1xxxx_otp_write(void *priv_t, unsigned int off,
goto error;
}
}
- ret = byte;
error:
release_sys_lock(priv);
return ret;
--
2.45.2.505.gda0bf45e8d-goog
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] misc: microchip: pci1xxxx: Fix return value of nvmem callbacks
2024-06-12 7:00 [PATCH] misc: microchip: pci1xxxx: Fix return value of nvmem callbacks Joy Chakraborty
@ 2024-06-12 7:41 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2024-06-12 7:41 UTC (permalink / raw)
To: Joy Chakraborty
Cc: Vaibhaav Ram T . L, Greg Kroah-Hartman, Kumaravel Thiagarajan,
Tharun Kumar P, Srinivas Kandagatla, linux-gpio, linux-kernel,
stable
On Wed, Jun 12, 2024 at 07:00:30AM +0000, Joy Chakraborty wrote:
> Read/write callbacks registered with nvmem core expect 0 to be returned
> on success and a negative value to be returned on failure.
>
> Currently pci1xxxx_otp_read()/pci1xxxx_otp_write() and
> pci1xxxx_eeprom_read()/pci1xxxx_eeprom_write() return the number of
> bytes read/written on success.
> Fix to return 0 on success.
>
> Fixes: 9ab5465349c0 ("misc: microchip: pci1xxxx: Add support to read and write into PCI1XXXX EEPROM via NVMEM sysfs")
> Fixes: 0969001569e4 ("misc: microchip: pci1xxxx: Add support to read and write into PCI1XXXX OTP via NVMEM sysfs")
> Cc: stable@vger.kernel.org
> Signed-off-by: Joy Chakraborty <joychakr@google.com>
Thanks!
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-06-12 7:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-12 7:00 [PATCH] misc: microchip: pci1xxxx: Fix return value of nvmem callbacks Joy Chakraborty
2024-06-12 7:41 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®