mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Stefan Windfeldt-Prytz <stefan.windfeldt-prytz@axis.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel@axis.com
Subject: Re: [PATCH 2/2] iio: light: Add support for TI OPT4001 light sensor
Date: Tue, 18 Apr 2023 18:34:22 +0200	[thread overview]
Message-ID: <72d5b078-da9e-ccbb-1557-9cacaea68e8d@linaro.org> (raw)
In-Reply-To: <20230323-add-opt4001-driver-v1-2-1451dcc1bc8a@axis.com>

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


  parent reply	other threads:[~2023-04-18 16:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04  9:07 [PATCH 0/2] Support for Texas Instruments OPT4001 Ambient Light Sensor Stefan Windfeldt-Prytz
2023-04-04  9:07 ` [PATCH 1/2] dt-bindings: Document TI OPT4001 light sensor bindings Stefan Windfeldt-Prytz
2023-04-04 15:39   ` Rob Herring
2023-04-07 17:58   ` Jonathan Cameron
2023-04-04  9:07 ` [PATCH 2/2] iio: light: Add support for TI OPT4001 light sensor Stefan Windfeldt-Prytz
2023-04-07 18:20   ` Jonathan Cameron
2023-04-18 16:34   ` Krzysztof Kozlowski [this message]
2023-04-18 16:35     ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72d5b078-da9e-ccbb-1557-9cacaea68e8d@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=kernel@axis.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=stefan.windfeldt-prytz@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®