iio: srf08: add device tree table
authorAndreas Klinger <ak@it-klinger.de>
Wed, 16 Aug 2017 19:33:47 +0000 (21:33 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 18 Aug 2017 06:59:07 +0000 (07:59 +0100)
Added MODULE_DEVICE_TABLE for device tree bindings.

It used to work without it by using the i2c_device_id table, but adding the
table makes everything clear and documented.

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/proximity/srf08.c

index 49316cbf7c60afb389eb82c600db06ff7142c2e3..3f19536f215f920b4f8449854644424fdefb7a1d 100644 (file)
@@ -378,6 +378,13 @@ static int srf08_probe(struct i2c_client *client,
        return devm_iio_device_register(&client->dev, indio_dev);
 }
 
+static const struct of_device_id of_srf08_match[] = {
+       { .compatible = "devantech,srf08", 0},
+       {},
+};
+
+MODULE_DEVICE_TABLE(of, of_srf08_match);
+
 static const struct i2c_device_id srf08_id[] = {
        { "srf08", 0 },
        { }
@@ -387,6 +394,7 @@ MODULE_DEVICE_TABLE(i2c, srf08_id);
 static struct i2c_driver srf08_driver = {
        .driver = {
                .name   = "srf08",
+               .of_match_table = of_srf08_match,
        },
        .probe = srf08_probe,
        .id_table = srf08_id,