diff mbox series

[34/38] iio:magn:ak8975: Drop of_match_ptr and ACPI_PTR protections.

Message ID 20200910173242.621168-35-jic23@kernel.org (mailing list archive)
State New, archived
Headers show
Series iio: remaining easy of_match_ptr removal and related. | expand

Commit Message

Jonathan Cameron Sept. 10, 2020, 5:32 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Both would result in only a small size saving.  For simplicity it
is best to remove them.  I also wish to remove both these antipatterns
from IIO.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jonathan Albrieux <jonathan.albrieux@gmail.com>
---
 drivers/iio/magnetometer/ak8975.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Jonathan Albrieux Sept. 11, 2020, 6:59 p.m. UTC | #1
On Thu, Sep 10, 2020 at 06:32:38PM +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Both would result in only a small size saving.  For simplicity it
> is best to remove them.  I also wish to remove both these antipatterns
> from IIO.
>

Hi Jonathan and thank you!

I compiled and tested this patch on ak09911 so, for what is worth,

Acked-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>
Tested-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>

Best regards,
Jonathan

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Jonathan Albrieux <jonathan.albrieux@gmail.com>
> ---
>  drivers/iio/magnetometer/ak8975.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
> index 03d71f796177..0141ef3b6476 100644
> --- a/drivers/iio/magnetometer/ak8975.c
> +++ b/drivers/iio/magnetometer/ak8975.c
> @@ -8,6 +8,7 @@
>   */
>  
>  #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/kernel.h>
>  #include <linux/slab.h>
>  #include <linux/i2c.h>
> @@ -17,7 +18,6 @@
>  #include <linux/delay.h>
>  #include <linux/bitops.h>
>  #include <linux/gpio/consumer.h>
> -#include <linux/acpi.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/pm_runtime.h>
>  
> @@ -773,7 +773,6 @@ static const struct iio_info ak8975_info = {
>  	.read_raw = &ak8975_read_raw,
>  };
>  
> -#ifdef CONFIG_ACPI
>  static const struct acpi_device_id ak_acpi_match[] = {
>  	{"AK8975", AK8975},
>  	{"AK8963", AK8963},
> @@ -785,7 +784,6 @@ static const struct acpi_device_id ak_acpi_match[] = {
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, ak_acpi_match);
> -#endif
>  
>  static void ak8975_fill_buffer(struct iio_dev *indio_dev)
>  {
> @@ -1075,8 +1073,8 @@ static struct i2c_driver ak8975_driver = {
>  	.driver = {
>  		.name	= "ak8975",
>  		.pm = &ak8975_dev_pm_ops,
> -		.of_match_table = of_match_ptr(ak8975_of_match),
> -		.acpi_match_table = ACPI_PTR(ak_acpi_match),
> +		.of_match_table = ak8975_of_match,
> +		.acpi_match_table = ak_acpi_match,
>  	},
>  	.probe		= ak8975_probe,
>  	.remove		= ak8975_remove,
> -- 
> 2.28.0
>
diff mbox series

Patch

diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
index 03d71f796177..0141ef3b6476 100644
--- a/drivers/iio/magnetometer/ak8975.c
+++ b/drivers/iio/magnetometer/ak8975.c
@@ -8,6 +8,7 @@ 
  */
 
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/i2c.h>
@@ -17,7 +18,6 @@ 
 #include <linux/delay.h>
 #include <linux/bitops.h>
 #include <linux/gpio/consumer.h>
-#include <linux/acpi.h>
 #include <linux/regulator/consumer.h>
 #include <linux/pm_runtime.h>
 
@@ -773,7 +773,6 @@  static const struct iio_info ak8975_info = {
 	.read_raw = &ak8975_read_raw,
 };
 
-#ifdef CONFIG_ACPI
 static const struct acpi_device_id ak_acpi_match[] = {
 	{"AK8975", AK8975},
 	{"AK8963", AK8963},
@@ -785,7 +784,6 @@  static const struct acpi_device_id ak_acpi_match[] = {
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, ak_acpi_match);
-#endif
 
 static void ak8975_fill_buffer(struct iio_dev *indio_dev)
 {
@@ -1075,8 +1073,8 @@  static struct i2c_driver ak8975_driver = {
 	.driver = {
 		.name	= "ak8975",
 		.pm = &ak8975_dev_pm_ops,
-		.of_match_table = of_match_ptr(ak8975_of_match),
-		.acpi_match_table = ACPI_PTR(ak_acpi_match),
+		.of_match_table = ak8975_of_match,
+		.acpi_match_table = ak_acpi_match,
 	},
 	.probe		= ak8975_probe,
 	.remove		= ak8975_remove,