[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1a72facf-422e-7a1a-032e-8760424b012d@linaro.org>
Date: Mon, 15 May 2023 08:18:20 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Anup Sharma <anupnewsmail@...il.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>,
Conor Dooley <conor+dt@...nel.org>,
Peter Meerwald <pmeerw@...erw.net>,
u.kleine-koenig@...gutronix.de, andriy.shevchenko@...ux.intel.com,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] iio: temperature: tmp006: Add OF device matching
support
On 14/05/2023 21:03, Anup Sharma wrote:
> Adds an of_device_id table entry to the driver, enabling
> device matching through device tree. With this update, the driver
> can now match devices using both the i2c_device_id entry and the
> newly added of_device_id table.
>
> Signed-off-by: Anup Sharma <anupnewsmail@...il.com>
> ---
> drivers/iio/temperature/tmp006.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/temperature/tmp006.c b/drivers/iio/temperature/tmp006.c
> index cdf08477e63f..2b1782263cc9 100644
> --- a/drivers/iio/temperature/tmp006.c
> +++ b/drivers/iio/temperature/tmp006.c
> @@ -17,6 +17,7 @@
> #include <linux/module.h>
> #include <linux/pm.h>
> #include <linux/bitops.h>
> +#include <linux/mod_devicetable.h>
>
> #include <linux/iio/iio.h>
> #include <linux/iio/sysfs.h>
> @@ -272,15 +273,22 @@ static int tmp006_resume(struct device *dev)
>
> static DEFINE_SIMPLE_DEV_PM_OPS(tmp006_pm_ops, tmp006_suspend, tmp006_resume);
>
> +static const struct of_device_id tmp006_of_match[] = {
> + { .compatible = "ti,tmp006", },
> + { }
> +};
> +
Drop blank line.
> +MODULE_DEVICE_TABLE(of, tmp006_of_match);
> +
> static const struct i2c_device_id tmp006_id[] = {
> { "tmp006", 0 },
> { }
> };
> -MODULE_DEVICE_TABLE(i2c, tmp006_id);
This should stay.
Best regards,
Krzysztof
Powered by blists - more mailing lists