Patch "iio: adc: mcp3911: correct "microchip,device-addr" property" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    iio: adc: mcp3911: correct "microchip,device-addr" property

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iio-adc-mcp3911-correct-microchip-device-addr-proper.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2dd64f7c6962c18d86d7cf6702143ae4b984a426
Author: Marcus Folkesson <marcus.folkesson@xxxxxxxxx>
Date:   Fri Jul 22 15:07:19 2022 +0200

    iio: adc: mcp3911: correct "microchip,device-addr" property
    
    [ Upstream commit cfbd76d5c9c449739bb74288d982bccf9ff822f4 ]
    
    Go for the right property name that is documented in the bindings.
    
    Fixes: 3a89b289df5d ("iio: adc: add support for mcp3911")
    Signed-off-by: Marcus Folkesson <marcus.folkesson@xxxxxxxxx>
    Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20220722130726.7627-3-marcus.folkesson@xxxxxxxxx
    Cc: <Stable@xxxxxxxxxxxxxxx>
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c
index 608842632925..7eecbfd491a4 100644
--- a/drivers/iio/adc/mcp3911.c
+++ b/drivers/iio/adc/mcp3911.c
@@ -217,7 +217,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",



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux