Skip to contentSkip to conversation

FAILED: patch "[PATCH] iio: adc: mcp3911: correct "microchip,device-addr" property" failed to apply to 5.4-stable tree

PATCH [email protected] 1 participant 1 message Sep 5, 2022

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.4-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]>.

thanks,

greg k-h

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

From cfbd76d5c9c449739bb74288d982bccf9ff822f4 Mon Sep 17 00:00:00 2001
From: Marcus Folkesson <[email protected]>
Date: Fri, 22 Jul 2022 15:07:19 +0200
Subject: [PATCH] iio: adc: mcp3911: correct "microchip,device-addr" property

Go for the right property name that is documented in the bindings.

drivers/iio/adc/mcp3911.c +8 -1
index f581cefb6719..f8875076ae80 100644
@@ -210,7 +210,14 @@ static int mcp3911_config(struct mcp3911 *adc)
 	u32 configreg;
 	int ret;
 
-	device_property_read_u32(dev, "device-addr", &adc->dev_addr);
+	ret = device_property_read_u32(dev, "microchip,device-addr", &adc->dev_addr);
+
+	/*
+	 * Fallback to "device-addr" due to historical mismatch between
+	 * dt-bindings and implementation
+	 */
+	if (ret)
+		device_property_read_u32(dev, "device-addr", &adc->dev_addr);
 	if (adc->dev_addr > 3) {
 		dev_err(&adc->spi->dev,
 			"invalid device address (%i). Must be in range 0-3.\n",