diff mbox series

[v5,1/6] dt-bindings: iio: adc: mcp3911: add support for the whole MCP39xx family

Message ID 20230814121010.184842-1-marcus.folkesson@gmail.com
State Superseded
Headers show
Series [v5,1/6] dt-bindings: iio: adc: mcp3911: add support for the whole MCP39xx family | expand

Commit Message

Marcus Folkesson Aug. 14, 2023, 12:10 p.m. UTC
Microchip does have many similar chips, add those to the compatible
string as the driver support is extended.

The new supported chips are:
  - microchip,mcp3910
  - microchip,mcp3912
  - microchip,mcp3913
  - microchip,mcp3914
  - microchip,mcp3918
  - microchip,mcp3919

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---

Notes:
    v2:
        - No changes
    v3:
        - No changes
    v4:
        - No changes
    v5:
        - No changes

 .../devicetree/bindings/iio/adc/microchip,mcp3911.yaml      | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Andy Shevchenko Aug. 15, 2023, 2:36 p.m. UTC | #1
On Mon, Aug 14, 2023 at 02:10:06PM +0200, Marcus Folkesson wrote:
> Simplify code by switch to dev_err_probe().
> 
> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
> ---
> 
> Notes:
>     v5:
>         - New patch in this series
> 
>  drivers/iio/adc/mcp3911.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c
> index 974c5bd923a6..681248a3ddde 100644
> --- a/drivers/iio/adc/mcp3911.c
> +++ b/drivers/iio/adc/mcp3911.c
> @@ -468,6 +468,7 @@ static int mcp3911_probe(struct spi_device *spi)
>  {
>  	struct iio_dev *indio_dev;
>  	struct mcp3911 *adc;
> +	struct device *dev = &spi->dev;
>  	int ret;

With preserved reversed xmas tree order (longer line comes first),
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

>  	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*adc));
> @@ -482,10 +483,7 @@ static int mcp3911_probe(struct spi_device *spi)
>  		if (PTR_ERR(adc->vref) == -ENODEV) {
>  			adc->vref = NULL;
>  		} else {
> -			dev_err(&adc->spi->dev,
> -				"failed to get regulator (%ld)\n",
> -				PTR_ERR(adc->vref));
> -			return PTR_ERR(adc->vref);
> +			return dev_err_probe(dev, PTR_ERR(adc->vref), "failed to get regulator\n");
>  		}
>  
>  	} else {
> @@ -504,10 +502,7 @@ static int mcp3911_probe(struct spi_device *spi)
>  		if (PTR_ERR(adc->clki) == -ENOENT) {
>  			adc->clki = NULL;
>  		} else {
> -			dev_err(&adc->spi->dev,
> -				"failed to get adc clk (%ld)\n",
> -				PTR_ERR(adc->clki));
> -			return PTR_ERR(adc->clki);
> +			return dev_err_probe(dev, PTR_ERR(adc->clki), "failed to get adc clk\n");
>  		}
>  	}
>  
> -- 
> 2.41.0
>
Andy Shevchenko Aug. 15, 2023, 2:58 p.m. UTC | #2
On Mon, Aug 14, 2023 at 02:10:08PM +0200, Marcus Folkesson wrote:
> The file does not make use of indentation properly.

> Fix that.

I'm not sure this is anyhow a fix. Yet you may refer to the checkpatch
if it complains.

...

This kind of change is preferred to be the last in the series or closer
to the end where no more code changed.
Marcus Folkesson Aug. 15, 2023, 4:55 p.m. UTC | #3
On Tue, Aug 15, 2023 at 05:58:13PM +0300, Andy Shevchenko wrote:
> On Mon, Aug 14, 2023 at 02:10:08PM +0200, Marcus Folkesson wrote:
> > The file does not make use of indentation properly.
> 
> > Fix that.
> 
> I'm not sure this is anyhow a fix. Yet you may refer to the checkpatch
> if it complains.
> 
> ...
> 
> This kind of change is preferred to be the last in the series or closer
> to the end where no more code changed.

Checkpatch did never complain about the formatting, but I got a few comments
during the review process about the formatting, so I went
through the whole file to fix it once for all.

I do not think that it has to be the last patch in the series.
All following patches has proper indentation.
Pretty much the same as the simplification of spi->dev I think.

If there is no strong opinions about it I think I will leave it as is.

> 
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 


Best regards,
Marcus Folkesson
Andy Shevchenko Aug. 15, 2023, 5:04 p.m. UTC | #4
On Tue, Aug 15, 2023 at 06:55:45PM +0200, Marcus Folkesson wrote:
> On Tue, Aug 15, 2023 at 05:58:13PM +0300, Andy Shevchenko wrote:
> > On Mon, Aug 14, 2023 at 02:10:08PM +0200, Marcus Folkesson wrote:
> > > The file does not make use of indentation properly.
> > 
> > > Fix that.
> > 
> > I'm not sure this is anyhow a fix. Yet you may refer to the checkpatch
> > if it complains.
> > 
> > ...
> > 
> > This kind of change is preferred to be the last in the series or closer
> > to the end where no more code changed.
> 
> Checkpatch did never complain about the formatting, but I got a few comments
> during the review process about the formatting, so I went
> through the whole file to fix it once for all.
> 
> I do not think that it has to be the last patch in the series.
> All following patches has proper indentation.
> Pretty much the same as the simplification of spi->dev I think.
> 
> If there is no strong opinions about it I think I will leave it as is.

I'm not a maintainer of IIO, so let them decide :-)
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/adc/microchip,mcp3911.yaml b/Documentation/devicetree/bindings/iio/adc/microchip,mcp3911.yaml
index f7b3fde4115a..06951ec5f5da 100644
--- a/Documentation/devicetree/bindings/iio/adc/microchip,mcp3911.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/microchip,mcp3911.yaml
@@ -18,7 +18,13 @@  description: |
 properties:
   compatible:
     enum:
+      - microchip,mcp3910
       - microchip,mcp3911
+      - microchip,mcp3912
+      - microchip,mcp3913
+      - microchip,mcp3914
+      - microchip,mcp3918
+      - microchip,mcp3919
 
   reg:
     maxItems: 1