[PATCH 6/7] iio: light: veml6070: add devicetree support

Javier Carrasco posted 7 patches 1 month, 4 weeks ago
[PATCH 6/7] iio: light: veml6070: add devicetree support
Posted by Javier Carrasco 1 month, 4 weeks ago
Register the compatible from the dt-bindings.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
 drivers/iio/light/veml6070.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/iio/light/veml6070.c b/drivers/iio/light/veml6070.c
index faba04e1da98..8d02899028d8 100644
--- a/drivers/iio/light/veml6070.c
+++ b/drivers/iio/light/veml6070.c
@@ -192,9 +192,16 @@ static const struct i2c_device_id veml6070_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, veml6070_id);
 
+static const struct of_device_id veml6070_of_match[] = {
+	{ .compatible = "vishay,veml6070" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, veml6070_of_match);
+
 static struct i2c_driver veml6070_driver = {
 	.driver = {
 		.name   = VEML6070_DRV_NAME,
+		.of_match_table = veml6070_of_match,
 	},
 	.probe = veml6070_probe,
 	.id_table = veml6070_id,

-- 
2.43.0
Re: [PATCH 6/7] iio: light: veml6070: add devicetree support
Posted by Jonathan Cameron 1 month, 4 weeks ago
On Sun, 29 Sep 2024 22:38:51 +0200
Javier Carrasco <javier.carrasco.cruz@gmail.com> wrote:

> Register the compatible from the dt-bindings.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> ---
>  drivers/iio/light/veml6070.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/iio/light/veml6070.c b/drivers/iio/light/veml6070.c
> index faba04e1da98..8d02899028d8 100644
> --- a/drivers/iio/light/veml6070.c
> +++ b/drivers/iio/light/veml6070.c
> @@ -192,9 +192,16 @@ static const struct i2c_device_id veml6070_id[] = {
>  };
>  MODULE_DEVICE_TABLE(i2c, veml6070_id);
>  
> +static const struct of_device_id veml6070_of_match[] = {
> +	{ .compatible = "vishay,veml6070" },
> +	{}
I tweaked this to { }

> +};
> +MODULE_DEVICE_TABLE(of, veml6070_of_match);
> +
>  static struct i2c_driver veml6070_driver = {
>  	.driver = {
>  		.name   = VEML6070_DRV_NAME,
> +		.of_match_table = veml6070_of_match,
>  	},
>  	.probe = veml6070_probe,
>  	.id_table = veml6070_id,
>