lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6673f3d4-b6d6-4024-8d44-2f120649d937@roeck-us.net>
Date:   Wed, 21 Jun 2023 08:35:53 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     JuenKit Yip <JuenKit_Yip@...mail.com>
Cc:     jdelvare@...e.com, linux-hwmon@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 2/2] hwmon: (sht3x) add device-tree support

On Wed, Jun 21, 2023 at 11:59:37AM +0800, JuenKit Yip wrote:
> add "compatible" property for supporting device-tree
> 
> Signed-off-by: JuenKit Yip <JuenKit_Yip@...mail.com>
> ---
>  drivers/hwmon/sht3x.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/sht3x.c b/drivers/hwmon/sht3x.c
> index 31013b5b6..edcf6820c 100644
> --- a/drivers/hwmon/sht3x.c
> +++ b/drivers/hwmon/sht3x.c
> @@ -923,8 +923,18 @@ static const struct i2c_device_id sht3x_ids[] = {
>  
>  MODULE_DEVICE_TABLE(i2c, sht3x_ids);
>  
> +/* devicetree ID table */
> +static const struct of_device_id sht3x_of_match[] = {
> +	{ .compatible = "sensirion,sht3x" },
> +	{ .compatible = "sensirion,sts3x" },

Also needs a separate patch addding the two devices
to Documentation/devicetree/bindings/trivial-devices.yaml.

> +	{},
> +};
> +
>  static struct i2c_driver sht3x_i2c_driver = {
> -	.driver.name = "sht3x",
> +	.driver = {
> +		.name = "sht3x",
> +		.of_match_table = of_match_ptr(sht3x_of_match),
> +	},
>  	.probe       = sht3x_probe,
>  	.id_table    = sht3x_ids,
>  };
> -- 
> 2.30.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ