[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <72d5b078-da9e-ccbb-1557-9cacaea68e8d@linaro.org>
Date: Tue, 18 Apr 2023 18:34:22 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Stefan Windfeldt-Prytz <stefan.windfeldt-prytz@...s.com>,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>
Cc: linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel@...s.com
Subject: Re: [PATCH 2/2] iio: light: Add support for TI OPT4001 light sensor
On 04/04/2023 11:07, Stefan Windfeldt-Prytz wrote:
> This driver uses the continuous mode of the chip and integration
> time can be configured through sysfs.
> The constants for calculating lux value differs between packaging
> so it uses different compatible string for the two versions
> "ti,opt4001-picostar" and "ti,opt4001-sot-5x3" since the device id
> is the same.
Thank you for your patch. There is something to discuss/improve.
> +
> + indio_dev->channels = opt4001_channels;
> + indio_dev->num_channels = ARRAY_SIZE(opt4001_channels);
> + indio_dev->modes = INDIO_DIRECT_MODE;
> + indio_dev->name = chip->client->name;
> +
> + of_id = of_match_device(of_match_ptr(opt4001_of_match), &client->dev);
? Drop of_match_ptr
> + chip->package_constants = of_id->data;
> +
> + ret = opt4001_load_defaults(chip);
> + if (ret < 0)
> + return dev_err_probe(&client->dev, ret,
> + "Failed to set sensor defaults\n");
> +
> + return devm_iio_device_register(&client->dev, indio_dev);
> +}
> +
> +static void opt4001_remove(struct i2c_client *client)
> +{
> + struct iio_dev *indio_dev = i2c_get_clientdata(client);
> + struct opt4001_chip *chip = iio_priv(indio_dev);
> +
> + opt4001_power_down(chip);
> +}
> +
> +static struct i2c_driver opt4001_driver = {
> + .driver = {
> + .name = "opt4001",
> + .of_match_table = of_match_ptr(opt4001_of_match),
This should sparkle some warnings. Drop of_match_ptr().
Best regards,
Krzysztof
Powered by blists - more mailing lists