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] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 12 Jan 2019 18:22:21 +0000
From:   Jonathan Cameron <jic23@...nel.org>
To:     Sebastien Bourdelin <sebastien.bourdelin@...il.com>
Cc:     linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
        linux-iio@...r.kernel.org, himanshujha199640@...il.com,
        mark.rutland@....com, robh+dt@...nel.org, pmeerw@...erw.net,
        lars@...afoo.de, knaack.h@....de
Subject: Re: [PATCH v2 1/2] iio: chemical: bme680: Add device-tree support

On Fri, 11 Jan 2019 15:53:58 -0500
Sebastien Bourdelin <sebastien.bourdelin@...il.com> wrote:

> This commit allow the driver to work with device-tree.
> 
> Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@...il.com>
Minor stuff inline.

J
> ---
> v1 -> v2:
>   - add missing of.h header in bme680_spi.c
> ---
>  drivers/iio/chemical/bme680_i2c.c | 7 +++++++
>  drivers/iio/chemical/bme680_spi.c | 9 +++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/drivers/iio/chemical/bme680_i2c.c b/drivers/iio/chemical/bme680_i2c.c
> index 06d4be539d2e..94a36ebdf0b2 100644
> --- a/drivers/iio/chemical/bme680_i2c.c
> +++ b/drivers/iio/chemical/bme680_i2c.c
> @@ -70,10 +70,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
>  };
>  MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
>  
> +static const struct of_device_id bme680_of_i2c_match[] = {
> +	{ .compatible = "bosch,bme680", },
> +	{},
> +}
> +MODULE_DEVICE_TABLE(of, bme680_of_i2c_match);
> +
>  static struct i2c_driver bme680_i2c_driver = {
>  	.driver = {
>  		.name			= "bme680_i2c",
>  		.acpi_match_table       = ACPI_PTR(bme680_acpi_match),
> +		.of_match_table		= of_match_ptr(bme680_of_i2c_match),

As below. just = bme680...

>  	},
>  	.probe = bme680_i2c_probe,
>  	.id_table = bme680_i2c_id,
> diff --git a/drivers/iio/chemical/bme680_spi.c b/drivers/iio/chemical/bme680_spi.c
> index c9fb05e8d0b9..caa57287a911 100644
> --- a/drivers/iio/chemical/bme680_spi.c
> +++ b/drivers/iio/chemical/bme680_spi.c
> @@ -6,9 +6,11 @@
>   */
>  #include <linux/acpi.h>
>  #include <linux/module.h>
> +#include <linux/of.h>
>  #include <linux/regmap.h>
>  #include <linux/spi/spi.h>
>  
> +

This white space change should not be here.

>  #include "bme680.h"
>  
>  static int bme680_regmap_spi_write(void *context, const void *data,
> @@ -110,10 +112,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
>  };
>  MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
>  
> +static const struct of_device_id bme680_of_spi_match[] = {
> +	{ .compatible = "bosch,bme680", },
> +	{},
> +}
> +MODULE_DEVICE_TABLE(of, bme680_of_spi_match);
> +
>  static struct spi_driver bme680_spi_driver = {
>  	.driver = {
>  		.name			= "bme680_spi",
>  		.acpi_match_table	= ACPI_PTR(bme680_acpi_match),
> +		.of_match_table		= of_match_ptr(bme680_of_spi_match),
Please don't use of_match_ptr.  We actually want this entry to be there even
if devicetree is not in use.  This is because there is a magic ACPI hid
that can use this table even from ACPI.

>  	},
>  	.probe = bme680_spi_probe,
>  	.id_table = bme680_spi_id,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ