diff options
author | Andreas Klinger <ak@it-klinger.de> | 2017-08-16 15:33:47 -0400 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2017-08-18 02:59:07 -0400 |
commit | c02b3a113d1b6d463e212711482bda280ecf34c1 (patch) | |
tree | a4fa1a1402abcea7c0550e96e64c509926a8545b | |
parent | fd63d9260a91aecb1330d02bfd573d9b7d47a72b (diff) |
iio: srf08: add device tree table
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>
-rw-r--r-- | drivers/iio/proximity/srf08.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/iio/proximity/srf08.c b/drivers/iio/proximity/srf08.c index 49316cbf7c60..3f19536f215f 100644 --- a/drivers/iio/proximity/srf08.c +++ b/drivers/iio/proximity/srf08.c | |||
@@ -378,6 +378,13 @@ static int srf08_probe(struct i2c_client *client, | |||
378 | return devm_iio_device_register(&client->dev, indio_dev); | 378 | return devm_iio_device_register(&client->dev, indio_dev); |
379 | } | 379 | } |
380 | 380 | ||
381 | static const struct of_device_id of_srf08_match[] = { | ||
382 | { .compatible = "devantech,srf08", 0}, | ||
383 | {}, | ||
384 | }; | ||
385 | |||
386 | MODULE_DEVICE_TABLE(of, of_srf08_match); | ||
387 | |||
381 | static const struct i2c_device_id srf08_id[] = { | 388 | static const struct i2c_device_id srf08_id[] = { |
382 | { "srf08", 0 }, | 389 | { "srf08", 0 }, |
383 | { } | 390 | { } |
@@ -387,6 +394,7 @@ MODULE_DEVICE_TABLE(i2c, srf08_id); | |||
387 | static struct i2c_driver srf08_driver = { | 394 | static struct i2c_driver srf08_driver = { |
388 | .driver = { | 395 | .driver = { |
389 | .name = "srf08", | 396 | .name = "srf08", |
397 | .of_match_table = of_srf08_match, | ||
390 | }, | 398 | }, |
391 | .probe = srf08_probe, | 399 | .probe = srf08_probe, |
392 | .id_table = srf08_id, | 400 | .id_table = srf08_id, |