]> git.baikalelectronics.ru Git - kernel.git/commitdiff
iio: accel: kxsd9-i2c: Use mod_devicetable.h and drop of_match_ptr macro
authorNishant Malpani <nish.malpani25@gmail.com>
Fri, 24 Apr 2020 22:44:38 +0000 (04:14 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 25 Apr 2020 14:31:34 +0000 (15:31 +0100)
Enables ACPI DSDT to probe via PRP0001 and the compatible property. Also
removes the ifdef protections for CONFIG_OF.

Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/kxsd9-i2c.c

index b6f3de7ef8ea1df482e43c84a76778b02bbdcec4..b580d605f8487cf7b9d873915026ee5423766f05 100644 (file)
@@ -2,6 +2,7 @@
 #include <linux/device.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/slab.h>
 #include <linux/i2c.h>
 #include <linux/delay.h>
@@ -36,15 +37,11 @@ static int kxsd9_i2c_remove(struct i2c_client *client)
        return kxsd9_common_remove(&client->dev);
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id kxsd9_of_match[] = {
        { .compatible = "kionix,kxsd9", },
        { },
 };
 MODULE_DEVICE_TABLE(of, kxsd9_of_match);
-#else
-#define kxsd9_of_match NULL
-#endif
 
 static const struct i2c_device_id kxsd9_i2c_id[] = {
        {"kxsd9", 0},
@@ -55,7 +52,7 @@ MODULE_DEVICE_TABLE(i2c, kxsd9_i2c_id);
 static struct i2c_driver kxsd9_i2c_driver = {
        .driver = {
                .name   = "kxsd9",
-               .of_match_table = of_match_ptr(kxsd9_of_match),
+               .of_match_table = kxsd9_of_match,
                .pm = &kxsd9_dev_pm_ops,
        },
        .probe          = kxsd9_i2c_probe,