diff mbox series

[1/2] hwmon: (hih6130) add dtb compatibility tables

Message ID 20181227151349.29753-2-andreas@kemnade.info (mailing list archive)
State Accepted
Headers show
Series hwmon: devicetree support for hih6130 | expand

Commit Message

Andreas Kemnade Dec. 27, 2018, 3:13 p.m. UTC
This allows the hih6130 to be used in devicetree files and auto-probed
that way.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
 drivers/hwmon/hih6130.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

Guenter Roeck Jan. 4, 2019, 4:25 a.m. UTC | #1
On Thu, Dec 27, 2018 at 04:13:48PM +0100, Andreas Kemnade wrote:
> This allows the hih6130 to be used in devicetree files and auto-probed
> that way.
> 
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>

Applie to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/hih6130.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/hih6130.c b/drivers/hwmon/hih6130.c
> index 0ae1ee1dbf76..de1b50ddc740 100644
> --- a/drivers/hwmon/hih6130.c
> +++ b/drivers/hwmon/hih6130.c
> @@ -254,8 +254,17 @@ static const struct i2c_device_id hih6130_id[] = {
>  };
>  MODULE_DEVICE_TABLE(i2c, hih6130_id);
>  
> +static const struct of_device_id hih6130_of_match[] = {
> +	{ .compatible = "honeywell,hih6130", },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, hih6130_of_match);
> +
>  static struct i2c_driver hih6130_driver = {
> -	.driver.name = "hih6130",
> +	.driver = {
> +		.name = "hih6130",
> +		.of_match_table = of_match_ptr(hih6130_of_match),
> +	},
>  	.probe       = hih6130_probe,
>  	.id_table    = hih6130_id,
>  };
diff mbox series

Patch

diff --git a/drivers/hwmon/hih6130.c b/drivers/hwmon/hih6130.c
index 0ae1ee1dbf76..de1b50ddc740 100644
--- a/drivers/hwmon/hih6130.c
+++ b/drivers/hwmon/hih6130.c
@@ -254,8 +254,17 @@  static const struct i2c_device_id hih6130_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, hih6130_id);
 
+static const struct of_device_id hih6130_of_match[] = {
+	{ .compatible = "honeywell,hih6130", },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, hih6130_of_match);
+
 static struct i2c_driver hih6130_driver = {
-	.driver.name = "hih6130",
+	.driver = {
+		.name = "hih6130",
+		.of_match_table = of_match_ptr(hih6130_of_match),
+	},
 	.probe       = hih6130_probe,
 	.id_table    = hih6130_id,
 };