diff mbox series

[v2,2/2] hwmon: (lm73) Add support for of_match_table

Message ID 20200212030615.28537-3-henry.shen@alliedtelesis.co.nz (mailing list archive)
State Accepted
Headers show
Series (lm73) Add support for of_match_table | expand

Commit Message

Henry Shen Feb. 12, 2020, 3:06 a.m. UTC
Add the of_match_table.

Signed-off-by: Henry Shen <henry.shen@alliedtelesis.co.nz>
---
Change in v2:
- add missing sign-off

 drivers/hwmon/lm73.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Guenter Roeck Feb. 19, 2020, 11:07 p.m. UTC | #1
On Wed, Feb 12, 2020 at 04:06:15PM +1300, Henry Shen wrote:
> Add the of_match_table.
> 
> Signed-off-by: Henry Shen <henry.shen@alliedtelesis.co.nz>

Applied to hwmon-next.

Thanks,
Guenter

> ---
> Change in v2:
> - add missing sign-off
> 
>  drivers/hwmon/lm73.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/hwmon/lm73.c b/drivers/hwmon/lm73.c
> index 1eeb9d7de2a0..733c48bf6c98 100644
> --- a/drivers/hwmon/lm73.c
> +++ b/drivers/hwmon/lm73.c
> @@ -262,10 +262,20 @@ static int lm73_detect(struct i2c_client *new_client,
>  	return 0;
>  }
>  
> +static const struct of_device_id lm73_of_match[] = {
> +	{
> +		.compatible = "ti,lm73",
> +	},
> +	{ },
> +};
> +
> +MODULE_DEVICE_TABLE(of, lm73_of_match);
> +
>  static struct i2c_driver lm73_driver = {
>  	.class		= I2C_CLASS_HWMON,
>  	.driver = {
>  		.name	= "lm73",
> +		.of_match_table = lm73_of_match,
>  	},
>  	.probe		= lm73_probe,
>  	.id_table	= lm73_ids,
diff mbox series

Patch

diff --git a/drivers/hwmon/lm73.c b/drivers/hwmon/lm73.c
index 1eeb9d7de2a0..733c48bf6c98 100644
--- a/drivers/hwmon/lm73.c
+++ b/drivers/hwmon/lm73.c
@@ -262,10 +262,20 @@  static int lm73_detect(struct i2c_client *new_client,
 	return 0;
 }
 
+static const struct of_device_id lm73_of_match[] = {
+	{
+		.compatible = "ti,lm73",
+	},
+	{ },
+};
+
+MODULE_DEVICE_TABLE(of, lm73_of_match);
+
 static struct i2c_driver lm73_driver = {
 	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name	= "lm73",
+		.of_match_table = lm73_of_match,
 	},
 	.probe		= lm73_probe,
 	.id_table	= lm73_ids,