Commit c02b3a11 authored by Andreas Klinger's avatar Andreas Klinger Committed by Jonathan Cameron

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: default avatarAndreas Klinger <ak@it-klinger.de>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent fd63d926
...@@ -378,6 +378,13 @@ static int srf08_probe(struct i2c_client *client, ...@@ -378,6 +378,13 @@ static int srf08_probe(struct i2c_client *client,
return devm_iio_device_register(&client->dev, indio_dev); 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[] = { static const struct i2c_device_id srf08_id[] = {
{ "srf08", 0 }, { "srf08", 0 },
{ } { }
...@@ -387,6 +394,7 @@ MODULE_DEVICE_TABLE(i2c, srf08_id); ...@@ -387,6 +394,7 @@ MODULE_DEVICE_TABLE(i2c, srf08_id);
static struct i2c_driver srf08_driver = { static struct i2c_driver srf08_driver = {
.driver = { .driver = {
.name = "srf08", .name = "srf08",
.of_match_table = of_srf08_match,
}, },
.probe = srf08_probe, .probe = srf08_probe,
.id_table = srf08_id, .id_table = srf08_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment