From: Jonathan Cameron <jic23@kernel.org>
To: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: <linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Stefan Popa <stefan.popa@analog.com>
Subject: Re: [PATCH v2] iio: adxl372_i2c: Add OF device ID table
Date: Sun, 26 Jul 2020 13:30:58 +0100 [thread overview]
Message-ID: <20200726133058.0b1f43b9@archlinux> (raw)
In-Reply-To: <20200722073003.67373-1-alexandru.ardelean@analog.com>
On Wed, 22 Jul 2020 10:30:03 +0300
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:
> From: Stefan Popa <stefan.popa@analog.com>
>
> The driver does not have a struct of_device_id table, but supported
> devices are registered via Device Trees. This patch adds OF device ID
> table.
>
> Signed-off-by: Stefan Popa <stefan.popa@analog.com>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied.
Thanks,
Jonathan
> ---
>
> Changelog v1 -> v2:
> * use linux/mod_devicetable.h include instead for the OF table
> * remove comma from null terminator
>
> drivers/iio/accel/adxl372_i2c.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/iio/accel/adxl372_i2c.c b/drivers/iio/accel/adxl372_i2c.c
> index e1affe480c77..9a07ab3d151a 100644
> --- a/drivers/iio/accel/adxl372_i2c.c
> +++ b/drivers/iio/accel/adxl372_i2c.c
> @@ -6,6 +6,7 @@
> */
>
> #include <linux/i2c.h>
> +#include <linux/mod_devicetable.h>
> #include <linux/module.h>
> #include <linux/regmap.h>
>
> @@ -46,9 +47,16 @@ static const struct i2c_device_id adxl372_i2c_id[] = {
> };
> MODULE_DEVICE_TABLE(i2c, adxl372_i2c_id);
>
> +static const struct of_device_id adxl372_of_match[] = {
> + { .compatible = "adi,adxl372" },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, adxl372_of_match);
> +
> static struct i2c_driver adxl372_i2c_driver = {
> .driver = {
> .name = "adxl372_i2c",
> + .of_match_table = adxl372_of_match,
> },
> .probe = adxl372_i2c_probe,
> .id_table = adxl372_i2c_id,
prev parent reply other threads:[~2020-07-26 12:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-20 13:49 [PATCH] iio: accel: adxl372: Add OF device ID table Alexandru Ardelean
2020-07-21 18:37 ` Andy Shevchenko
2020-07-22 7:08 ` Alexandru Ardelean
2020-07-22 7:30 ` [PATCH v2] iio: adxl372_i2c: " Alexandru Ardelean
2020-07-26 12:30 ` Jonathan Cameron [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=20200726133058.0b1f43b9@archlinux \
--to=jic23@kernel.org \
--cc=alexandru.ardelean@analog.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stefan.popa@analog.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;
as well as URLs for NNTP newsgroup(s).