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>,
"Hans de Goede" <hdegoede@redhat.com>,
"Vladimir Oltean" <olteanv@gmail.com>,
"Mehdi Djait" <mehdi.djait.k@gmail.com>,
"Rob Herring" <robh@kernel.org>,
linux-iio@vger.kernel.org,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] iio: accel: mma8452: Convert enum->pointer for data in the ID table
Date: Tue, 15 Aug 2023 09:46:36 +0300 [thread overview]
Message-ID: <ZNsfTH3l27oJIT+W@smile.fi.intel.com> (raw)
In-Reply-To: <20230812143100.159700-1-biju.das.jz@bp.renesas.com>
On Sat, Aug 12, 2023 at 03:31:00PM +0100, Biju Das wrote:
> Convert enum->pointer for data in the ID table, 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 *mma_chip_info for data in the ID table and simplify
> mma8452_probe() by replacing device_get_match_data() with
> i2c_get_match_data().
...
> static const struct i2c_device_id mma8452_id[] = {
> - { "mma8451", mma8451 },
> - { "mma8452", mma8452 },
> - { "mma8453", mma8453 },
> - { "mma8652", mma8652 },
> - { "mma8653", mma8653 },
> - { "fxls8471", fxls8471 },
> + { "mma8451", (kernel_ulong_t)&mma_chip_info_table[mma8451] },
> + { "mma8452", (kernel_ulong_t)&mma_chip_info_table[mma8452] },
> + { "mma8453", (kernel_ulong_t)&mma_chip_info_table[mma8453] },
> + { "mma8652", (kernel_ulong_t)&mma_chip_info_table[mma8652] },
> + { "mma8653", (kernel_ulong_t)&mma_chip_info_table[mma8653] },
> + { "fxls8471", (kernel_ulong_t)&mma_chip_info_table[fxls8471] },
You can also keep it sorted by name.
> { }
> };
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-08-15 6:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-12 14:31 [PATCH] iio: accel: mma8452: Convert enum->pointer for data in the ID table Biju Das
2023-08-12 14:47 ` Hans de Goede
2023-08-15 6:46 ` Andy Shevchenko [this message]
2023-08-15 6:54 ` Biju Das
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=ZNsfTH3l27oJIT+W@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=geert+renesas@glider.be \
--cc=hdegoede@redhat.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mehdi.djait.k@gmail.com \
--cc=olteanv@gmail.com \
--cc=robh@kernel.org \
--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