[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Ve2RigBHxn9s=MCY0zE66-vUhJtaixi3kSqYmKp7KR6eg@mail.gmail.com>
Date: Wed, 20 Aug 2025 13:09:37 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Ben Collins <bcollins@...ter.com>
Cc: Jonathan Cameron <jic23@...nel.org>, David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Andrew Hepp <andrew.hepp@...pp.dev>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 5/5] iio: mcp9600: Add support for thermocouple-type
On Wed, Aug 20, 2025 at 2:45 AM Ben Collins <bcollins@...ter.com> wrote:
>
> dt-bindings documentation for this driver claims to support
> thermocouple-type, but the driver does not actually make use of
> the property.
>
> Implement usage of the property to configure the chip for the
> selected thermocouple-type.
...
> + /* Accept type from dt with default of Type-K. */
> + data->thermocouple_type = THERMOCOUPLE_TYPE_K;
> + ret = device_property_read_u32(&client->dev, "thermocouple-type",
> + &data->thermocouple_type);
> + if (ret < 0 && ret != -EINVAL)
' < 0' part is redundant.
> + return dev_err_probe(&client->dev, ret,
> + "Error reading thermocouple-type property\n");
> +
> + if (data->thermocouple_type >= ARRAY_SIZE(mcp9600_type_map))
> + return dev_err_probe(&client->dev, -EINVAL,
> + "Invalid thermocouple-type property %u.\n",
> + data->thermocouple_type);
...
> + /* Set initial config. */
> + ret = mcp9600_config(data);
> + if (ret < 0)
Maybe here as well, but I haven't checked the actual code of the callee.
> + return ret;
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists