Message ID | 20220625103853.2470346-1-marcus.folkesson@gmail.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | [v2,01/10] iio: adc: mcp3911: correct "microchip,device-addr" property | expand |
On Sat, 25 Jun 2022 12:38:44 +0200 Marcus Folkesson <marcus.folkesson@gmail.com> wrote: > Go for the right property name that is documented in the bindings. > > Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Need a fixes tag so we know how far to back port this. > --- > > 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 Multiline comment syntax should be /* * Fallabck to "... * dt-... ` */ > + * 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",
On Sat, 25 Jun 2022 12:38:44 +0200 Marcus Folkesson <marcus.folkesson@gmail.com> wrote: > Go for the right property name that is documented in the bindings. > > Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Hi Marcus, Series with more than 1 or 2 patches should always have a cover letter (git format-patch --cover-letter) to provide some overview information and allow for general comments on the series. Also, whilst I know you are keen to move forwards quickly it is usually a good idea to give more than 2 days for all reviews to come in on a series and discussion of any questions to finish. For instance, I just replied to your question to Andy on patch 2 and that basically says your patch 2 in v2 is taking the wrong approach. If you'd waited a few more days you'd have save on the noise by resolving that before sending more patches. Thanks, Jonathan > --- > > 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",
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",
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(-)