Skip to contentSkip to conversation

FAILED: patch "[PATCH] nvmem: meson-efuse: Fix return value of nvmem callbacks" failed to apply to 4.19-stable tree

PATCH [email protected] 1 participant 1 message Jul 15, 2024

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.19.y
git checkout FETCH_HEAD
git cherry-pick -x 7a0a6d0a7c805f9380381f4deedffdf87b93f408
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2024071511-unwritten-backache-b96e@gregkh' --subject-prefix 'PATCH 4.19.y' HEAD^..

Possible dependencies:

7a0a6d0a7c80 ("nvmem: meson-efuse: Fix return value of nvmem callbacks") 8cde3c2153e8 ("firmware: meson_sm: Rework driver as a proper platform driver") 611fbca1c861 ("nvmem: meson-efuse: add peripheral clock") 8649dbe58d35 ("nvmem: meson-efuse: add error message on user_max failure.") 0789724f86a5 ("firmware: meson_sm: Add serial number sysfs entry")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 7a0a6d0a7c805f9380381f4deedffdf87b93f408 Mon Sep 17 00:00:00 2001
From: Joy Chakraborty <[email protected]>
Date: Fri, 28 Jun 2024 12:37:02 +0100
Subject: [PATCH] nvmem: meson-efuse: Fix return value of nvmem callbacks

Read/write callbacks registered with nvmem core expect 0 to be returned on success and a negative value to be returned on failure.

meson_efuse_read() and meson_efuse_write() call into meson_sm_call_read() and meson_sm_call_write() respectively which return the number of bytes read or written on success as per their api description.

Fix to return error if meson_sm_call_read()/meson_sm_call_write() returns an error else return 0.

drivers/nvmem/meson-efuse.c +10 -4
index 33678d0af2c2..6c2f80e166e2 100644
@@ -18,18 +18,24 @@ static int meson_efuse_read(void *context, unsigned int offset,
 			    void *val, size_t bytes)
 {
 	struct meson_sm_firmware *fw = context;
+	int ret;
 
-	return meson_sm_call_read(fw, (u8 *)val, bytes, SM_EFUSE_READ, offset,
-				  bytes, 0, 0, 0);
+	ret = meson_sm_call_read(fw, (u8 *)val, bytes, SM_EFUSE_READ, offset,
+				 bytes, 0, 0, 0);
+
+	return ret < 0 ? ret : 0;
 }
 
 static int meson_efuse_write(void *context, unsigned int offset,
 			     void *val, size_t bytes)
 {
 	struct meson_sm_firmware *fw = context;
+	int ret;
 
-	return meson_sm_call_write(fw, (u8 *)val, bytes, SM_EFUSE_WRITE, offset,
-				   bytes, 0, 0, 0);
+	ret = meson_sm_call_write(fw, (u8 *)val, bytes, SM_EFUSE_WRITE, offset,
+				  bytes, 0, 0, 0);
+
+	return ret < 0 ? ret : 0;
 }
 
 static const struct of_device_id meson_efuse_match[] = {