linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] iio: pressure: bmp280: Drop ACPI support
@ 2019-12-09 18:28 Andy Shevchenko
  2019-12-09 18:28 ` [PATCH v1 2/2] iio: pressure: bmp280: Allow device to be enumerated from ACPI Andy Shevchenko
  2019-12-23 18:06 ` [PATCH v1 1/2] iio: pressure: bmp280: Drop ACPI support Jonathan Cameron
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2019-12-09 18:28 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler
  Cc: Andy Shevchenko, Vlad Dogaru, Akinobu Mita, Matt Ranostay

There is no evidence of officially registered ACPI IDs for these devices.
Thus, revert ACPI support from the driver. All authors of the respective
changes are being informed here:

  d5c94568cc1d ("iio: add bmp280 pressure and temperature driver")
  6dba72eca7fb ("iio: pressure: bmp280: add support for BMP180")
  14beaa8f5ab1 ("iio: pressure: bmp280: add humidity support")

Above seems a cargo cult without paying attention to how ACPI IDs
are being allocated.

Cc: Vlad Dogaru <ddvlad@gmail.com>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/pressure/bmp280-i2c.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c
index 3109c8e2cc11..06f90853c141 100644
--- a/drivers/iio/pressure/bmp280-i2c.c
+++ b/drivers/iio/pressure/bmp280-i2c.c
@@ -1,7 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include <linux/module.h>
 #include <linux/i2c.h>
-#include <linux/acpi.h>
 #include <linux/of.h>
 #include <linux/regmap.h>
 
@@ -38,15 +37,6 @@ static int bmp280_i2c_probe(struct i2c_client *client,
 				   client->irq);
 }
 
-static const struct acpi_device_id bmp280_acpi_i2c_match[] = {
-	{"BMP0280", BMP280_CHIP_ID },
-	{"BMP0180", BMP180_CHIP_ID },
-	{"BMP0085", BMP180_CHIP_ID },
-	{"BME0280", BME280_CHIP_ID },
-	{ },
-};
-MODULE_DEVICE_TABLE(acpi, bmp280_acpi_i2c_match);
-
 #ifdef CONFIG_OF
 static const struct of_device_id bmp280_of_i2c_match[] = {
 	{ .compatible = "bosch,bme280", .data = (void *)BME280_CHIP_ID },
@@ -72,7 +62,6 @@ MODULE_DEVICE_TABLE(i2c, bmp280_i2c_id);
 static struct i2c_driver bmp280_i2c_driver = {
 	.driver = {
 		.name	= "bmp280",
-		.acpi_match_table = ACPI_PTR(bmp280_acpi_i2c_match),
 		.of_match_table = of_match_ptr(bmp280_of_i2c_match),
 		.pm = &bmp280_dev_pm_ops,
 	},
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v1 2/2] iio: pressure: bmp280: Allow device to be enumerated from ACPI
  2019-12-09 18:28 [PATCH v1 1/2] iio: pressure: bmp280: Drop ACPI support Andy Shevchenko
@ 2019-12-09 18:28 ` Andy Shevchenko
  2019-12-23 18:06   ` Jonathan Cameron
  2019-12-23 18:06 ` [PATCH v1 1/2] iio: pressure: bmp280: Drop ACPI support Jonathan Cameron
  1 sibling, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2019-12-09 18:28 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler
  Cc: Andy Shevchenko

There is no need to limit the driver use by OF/platform code.
In this case we simple remove redundant OF parts from the code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/pressure/bmp280-i2c.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c
index 06f90853c141..8b03ea15c0d0 100644
--- a/drivers/iio/pressure/bmp280-i2c.c
+++ b/drivers/iio/pressure/bmp280-i2c.c
@@ -1,7 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include <linux/module.h>
 #include <linux/i2c.h>
-#include <linux/of.h>
 #include <linux/regmap.h>
 
 #include "bmp280.h"
@@ -37,7 +36,6 @@ static int bmp280_i2c_probe(struct i2c_client *client,
 				   client->irq);
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id bmp280_of_i2c_match[] = {
 	{ .compatible = "bosch,bme280", .data = (void *)BME280_CHIP_ID },
 	{ .compatible = "bosch,bmp280", .data = (void *)BMP280_CHIP_ID },
@@ -46,9 +44,6 @@ static const struct of_device_id bmp280_of_i2c_match[] = {
 	{ },
 };
 MODULE_DEVICE_TABLE(of, bmp280_of_i2c_match);
-#else
-#define bmp280_of_i2c_match NULL
-#endif
 
 static const struct i2c_device_id bmp280_i2c_id[] = {
 	{"bmp280", BMP280_CHIP_ID },
@@ -62,7 +57,7 @@ MODULE_DEVICE_TABLE(i2c, bmp280_i2c_id);
 static struct i2c_driver bmp280_i2c_driver = {
 	.driver = {
 		.name	= "bmp280",
-		.of_match_table = of_match_ptr(bmp280_of_i2c_match),
+		.of_match_table = bmp280_of_i2c_match,
 		.pm = &bmp280_dev_pm_ops,
 	},
 	.probe		= bmp280_i2c_probe,
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 2/2] iio: pressure: bmp280: Allow device to be enumerated from ACPI
  2019-12-09 18:28 ` [PATCH v1 2/2] iio: pressure: bmp280: Allow device to be enumerated from ACPI Andy Shevchenko
@ 2019-12-23 18:06   ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2019-12-23 18:06 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-iio, Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler

On Mon,  9 Dec 2019 20:28:05 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> There is no need to limit the driver use by OF/platform code.
> In this case we simple remove redundant OF parts from the code.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Applied,

Thanks,

Jonathan

> ---
>  drivers/iio/pressure/bmp280-i2c.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c
> index 06f90853c141..8b03ea15c0d0 100644
> --- a/drivers/iio/pressure/bmp280-i2c.c
> +++ b/drivers/iio/pressure/bmp280-i2c.c
> @@ -1,7 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0-only
>  #include <linux/module.h>
>  #include <linux/i2c.h>
> -#include <linux/of.h>
>  #include <linux/regmap.h>
>  
>  #include "bmp280.h"
> @@ -37,7 +36,6 @@ static int bmp280_i2c_probe(struct i2c_client *client,
>  				   client->irq);
>  }
>  
> -#ifdef CONFIG_OF
>  static const struct of_device_id bmp280_of_i2c_match[] = {
>  	{ .compatible = "bosch,bme280", .data = (void *)BME280_CHIP_ID },
>  	{ .compatible = "bosch,bmp280", .data = (void *)BMP280_CHIP_ID },
> @@ -46,9 +44,6 @@ static const struct of_device_id bmp280_of_i2c_match[] = {
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, bmp280_of_i2c_match);
> -#else
> -#define bmp280_of_i2c_match NULL
> -#endif
>  
>  static const struct i2c_device_id bmp280_i2c_id[] = {
>  	{"bmp280", BMP280_CHIP_ID },
> @@ -62,7 +57,7 @@ MODULE_DEVICE_TABLE(i2c, bmp280_i2c_id);
>  static struct i2c_driver bmp280_i2c_driver = {
>  	.driver = {
>  		.name	= "bmp280",
> -		.of_match_table = of_match_ptr(bmp280_of_i2c_match),
> +		.of_match_table = bmp280_of_i2c_match,
>  		.pm = &bmp280_dev_pm_ops,
>  	},
>  	.probe		= bmp280_i2c_probe,


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/2] iio: pressure: bmp280: Drop ACPI support
  2019-12-09 18:28 [PATCH v1 1/2] iio: pressure: bmp280: Drop ACPI support Andy Shevchenko
  2019-12-09 18:28 ` [PATCH v1 2/2] iio: pressure: bmp280: Allow device to be enumerated from ACPI Andy Shevchenko
@ 2019-12-23 18:06 ` Jonathan Cameron
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2019-12-23 18:06 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-iio, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Vlad Dogaru, Akinobu Mita, Matt Ranostay

On Mon,  9 Dec 2019 20:28:04 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> There is no evidence of officially registered ACPI IDs for these devices.
> Thus, revert ACPI support from the driver. All authors of the respective
> changes are being informed here:
> 
>   d5c94568cc1d ("iio: add bmp280 pressure and temperature driver")
>   6dba72eca7fb ("iio: pressure: bmp280: add support for BMP180")
>   14beaa8f5ab1 ("iio: pressure: bmp280: add humidity support")
> 
> Above seems a cargo cult without paying attention to how ACPI IDs
> are being allocated.
> 
> Cc: Vlad Dogaru <ddvlad@gmail.com>
> Cc: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Matt Ranostay <mranostay@gmail.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Good indeed to clean some of these out. I'm personally a lot more familiar
with the delights of ACPI than I was back then (and know the person
with the hisilicon list all too well ;)

Anyhow, applied to the togreg branch of iio.git and pushed out as
testing though I can't imagine how this would break.

Thanks,

Jonathan

> ---
>  drivers/iio/pressure/bmp280-i2c.c | 11 -----------
>  1 file changed, 11 deletions(-)
> 
> diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c
> index 3109c8e2cc11..06f90853c141 100644
> --- a/drivers/iio/pressure/bmp280-i2c.c
> +++ b/drivers/iio/pressure/bmp280-i2c.c
> @@ -1,7 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0-only
>  #include <linux/module.h>
>  #include <linux/i2c.h>
> -#include <linux/acpi.h>
>  #include <linux/of.h>
>  #include <linux/regmap.h>
>  
> @@ -38,15 +37,6 @@ static int bmp280_i2c_probe(struct i2c_client *client,
>  				   client->irq);
>  }
>  
> -static const struct acpi_device_id bmp280_acpi_i2c_match[] = {
> -	{"BMP0280", BMP280_CHIP_ID },
> -	{"BMP0180", BMP180_CHIP_ID },
> -	{"BMP0085", BMP180_CHIP_ID },
> -	{"BME0280", BME280_CHIP_ID },
> -	{ },
> -};
> -MODULE_DEVICE_TABLE(acpi, bmp280_acpi_i2c_match);
> -
>  #ifdef CONFIG_OF
>  static const struct of_device_id bmp280_of_i2c_match[] = {
>  	{ .compatible = "bosch,bme280", .data = (void *)BME280_CHIP_ID },
> @@ -72,7 +62,6 @@ MODULE_DEVICE_TABLE(i2c, bmp280_i2c_id);
>  static struct i2c_driver bmp280_i2c_driver = {
>  	.driver = {
>  		.name	= "bmp280",
> -		.acpi_match_table = ACPI_PTR(bmp280_acpi_i2c_match),
>  		.of_match_table = of_match_ptr(bmp280_of_i2c_match),
>  		.pm = &bmp280_dev_pm_ops,
>  	},


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-23 18:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 18:28 [PATCH v1 1/2] iio: pressure: bmp280: Drop ACPI support Andy Shevchenko
2019-12-09 18:28 ` [PATCH v1 2/2] iio: pressure: bmp280: Allow device to be enumerated from ACPI Andy Shevchenko
2019-12-23 18:06   ` Jonathan Cameron
2019-12-23 18:06 ` [PATCH v1 1/2] iio: pressure: bmp280: Drop ACPI support Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).