All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 01/10] iio: adc: mcp3911: correct "microchip,device-addr" property
@ 2022-06-25 10:38 Marcus Folkesson
  2022-06-25 10:38 ` [PATCH v2 02/10] iio: adc: mcp3911: use resource-managed version of iio_device_register Marcus Folkesson
                   ` (10 more replies)
  0 siblings, 11 replies; 27+ messages in thread
From: Marcus Folkesson @ 2022-06-25 10:38 UTC (permalink / raw)
  To: Marcus Folkesson, Kent Gustavsson, Jonathan Cameron,
	Lars-Peter Clausen, Rob Herring, Krzysztof Kozlowski
  Cc: linux-iio, devicetree, linux-kernel

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

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---

Notes:
    v2:
        - Fallback to "device-addr" due to compatibility (Andy Shevchenko)

 drivers/iio/adc/mcp3911.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c
index 1cb4590fe412..c5a0f19d7834 100644
--- a/drivers/iio/adc/mcp3911.c
+++ b/drivers/iio/adc/mcp3911.c
@@ -208,7 +208,13 @@ 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",
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2022-07-07 17:47 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-25 10:38 [PATCH v2 01/10] iio: adc: mcp3911: correct "microchip,device-addr" property Marcus Folkesson
2022-06-25 10:38 ` [PATCH v2 02/10] iio: adc: mcp3911: use resource-managed version of iio_device_register Marcus Folkesson
2022-06-25 11:30   ` Jonathan Cameron
2022-06-25 10:38 ` [PATCH v2 03/10] iio: adc: mcp3911: add support for buffers Marcus Folkesson
2022-06-25 11:45   ` Jonathan Cameron
2022-06-30  8:32     ` Marcus Folkesson
2022-07-07 17:57       ` Jonathan Cameron
2022-06-25 10:38 ` [PATCH v2 04/10] iio: adc: mcp3911: add support for interrupts Marcus Folkesson
2022-06-25 11:56   ` Jonathan Cameron
2022-06-25 12:06     ` Jonathan Cameron
2022-06-29  7:44       ` Stephen Boyd
2022-07-03 19:18       ` Marcus Folkesson
2022-06-25 10:38 ` [PATCH v2 05/10] dt-bindings: iio: adc: mcp3911: add microchip,data-ready-hiz entry Marcus Folkesson
2022-06-25 20:06   ` Krzysztof Kozlowski
2022-06-25 10:38 ` [PATCH v2 06/10] iio: adc: mcp3911: add support for oversampling ratio Marcus Folkesson
2022-06-25 12:14   ` Jonathan Cameron
2022-06-25 10:38 ` [PATCH v2 07/10] iio: adc: mcp3911: use correct formula for AD conversion Marcus Folkesson
2022-06-25 12:16   ` Jonathan Cameron
2022-06-25 10:38 ` [PATCH v2 08/10] iio: adc: mcp3911: add support for phase Marcus Folkesson
2022-06-25 12:47   ` Jonathan Cameron
2022-06-25 10:38 ` [PATCH v2 09/10] iio: adc: mcp3911: make use of the sign bit Marcus Folkesson
2022-06-25 12:48   ` Jonathan Cameron
2022-06-25 10:38 ` [PATCH v2 10/10] iio: adc: mcp3911: add support to set PGA Marcus Folkesson
2022-06-25 12:08   ` kernel test robot
2022-06-25 12:54   ` Jonathan Cameron
2022-06-25 11:26 ` [PATCH v2 01/10] iio: adc: mcp3911: correct "microchip,device-addr" property Jonathan Cameron
2022-06-25 11:29 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.