Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio:pressure:zpa2326: Drop of_match_ptr protection

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Gregor Boirie <gregor.boirie@parrot.com>
Link: https://lore.kernel.org/r/20200910173242.621168-21-jic23@kernel.org

+4 -8
+2 -4
drivers/iio/pressure/zpa2326_i2c.c
··· 10 10 #include <linux/module.h> 11 11 #include <linux/regmap.h> 12 12 #include <linux/i2c.h> 13 - #include <linux/of_device.h> 13 + #include <linux/mod_devicetable.h> 14 14 #include "zpa2326.h" 15 15 16 16 /* ··· 66 66 }; 67 67 MODULE_DEVICE_TABLE(i2c, zpa2326_i2c_ids); 68 68 69 - #if defined(CONFIG_OF) 70 69 static const struct of_device_id zpa2326_i2c_matches[] = { 71 70 { .compatible = "murata,zpa2326" }, 72 71 { } 73 72 }; 74 73 MODULE_DEVICE_TABLE(of, zpa2326_i2c_matches); 75 - #endif 76 74 77 75 static struct i2c_driver zpa2326_i2c_driver = { 78 76 .driver = { 79 77 .name = "zpa2326-i2c", 80 - .of_match_table = of_match_ptr(zpa2326_i2c_matches), 78 + .of_match_table = zpa2326_i2c_matches, 81 79 .pm = ZPA2326_PM_OPS, 82 80 }, 83 81 .probe = zpa2326_probe_i2c,
+2 -4
drivers/iio/pressure/zpa2326_spi.c
··· 10 10 #include <linux/module.h> 11 11 #include <linux/regmap.h> 12 12 #include <linux/spi/spi.h> 13 - #include <linux/of_device.h> 13 + #include <linux/mod_devicetable.h> 14 14 #include "zpa2326.h" 15 15 16 16 /* ··· 70 70 }; 71 71 MODULE_DEVICE_TABLE(spi, zpa2326_spi_ids); 72 72 73 - #if defined(CONFIG_OF) 74 73 static const struct of_device_id zpa2326_spi_matches[] = { 75 74 { .compatible = "murata,zpa2326" }, 76 75 { } 77 76 }; 78 77 MODULE_DEVICE_TABLE(of, zpa2326_spi_matches); 79 - #endif 80 78 81 79 static struct spi_driver zpa2326_spi_driver = { 82 80 .driver = { 83 81 .name = "zpa2326-spi", 84 - .of_match_table = of_match_ptr(zpa2326_spi_matches), 82 + .of_match_table = zpa2326_spi_matches, 85 83 .pm = ZPA2326_PM_OPS, 86 84 }, 87 85 .probe = zpa2326_probe_spi,