From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Peter Rosin" <peda@axentia.se>,
"Krzysztof Hałasa" <khalasa@piap.pl>,
linux-iio@vger.kernel.org,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] iio: chemical: atlas-sensor: Convert enum->pointer for data in the match tables
Date: Tue, 15 Aug 2023 17:49:38 +0300 [thread overview]
Message-ID: <ZNuQggfB1jxlL5cW@smile.fi.intel.com> (raw)
In-Reply-To: <20230812171330.226247-1-biju.das.jz@bp.renesas.com>
On Sat, Aug 12, 2023 at 06:13:30PM +0100, Biju Das wrote:
> Convert enum->pointer for data in the match tables, so that
> device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c
> bus type match support added to it.
>
> Replace enum->struct *atlas_device for data in the match table. Simplify
> the probe() by replacing device_get_match_data() and ID lookup for
> retrieving data by i2c_get_match_data().
>
> While at it, add const qualifier to struct atlas_device and drop unused
> id variable from probe().
Same comments for id variable removal.
With that addressed and below remark,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
...
> static const struct of_device_id atlas_dt_ids[] = {
> - { .compatible = "atlas,ph-sm", .data = (void *)ATLAS_PH_SM, },
> - { .compatible = "atlas,ec-sm", .data = (void *)ATLAS_EC_SM, },
> - { .compatible = "atlas,orp-sm", .data = (void *)ATLAS_ORP_SM, },
> - { .compatible = "atlas,do-sm", .data = (void *)ATLAS_DO_SM, },
> - { .compatible = "atlas,rtd-sm", .data = (void *)ATLAS_RTD_SM, },
> + { .compatible = "atlas,ph-sm", .data = &atlas_devices[ATLAS_PH_SM], },
> + { .compatible = "atlas,ec-sm", .data = &atlas_devices[ATLAS_EC_SM], },
> + { .compatible = "atlas,orp-sm", .data = &atlas_devices[ATLAS_ORP_SM], },
> + { .compatible = "atlas,do-sm", .data = &atlas_devices[ATLAS_DO_SM], },
> + { .compatible = "atlas,rtd-sm", .data = &atlas_devices[ATLAS_RTD_SM], },
Now drop inner trailing commas.
> { }
> };
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2023-08-15 14:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-12 17:13 [PATCH] iio: chemical: atlas-sensor: Convert enum->pointer for data in the match tables Biju Das
2023-08-15 14:49 ` Andy Shevchenko [this message]
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=ZNuQggfB1jxlL5cW@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=geert+renesas@glider.be \
--cc=jic23@kernel.org \
--cc=khalasa@piap.pl \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=peda@axentia.se \
--cc=u.kleine-koenig@pengutronix.de \
/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