diff options
| author | Marco Felsch <m.felsch@pengutronix.de> | 2019-09-17 16:56:36 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-17 13:47:28 -0700 |
| commit | c57aac26b21ec01dcf6e6ae84f12963ece70bf32 (patch) | |
| tree | b5c9cd9b58b9459616c215589e3326185341bd13 | |
| parent | 37518c7f00aabc61cc0eabe0492b426c5be0c70c (diff) | |
| download | linux-c57aac26b21ec01dcf6e6ae84f12963ece70bf32.tar.gz linux-c57aac26b21ec01dcf6e6ae84f12963ece70bf32.tar.bz2 linux-c57aac26b21ec01dcf6e6ae84f12963ece70bf32.zip | |
iio: light: fix vcnl4000 devicetree hooks
[ Upstream commit 1436a78c63495dd94c8d4f84a76d78d5317d481b ]
Since commit ebd457d55911 ("iio: light: vcnl4000 add devicetree hooks")
the of_match_table is supported but the data shouldn't be a string.
Instead it shall be one of 'enum vcnl4000_device_ids'. Also the matching
logic for the vcnl4020 was wrong. Since the data retrieve mechanism is
still based on the i2c_device_id no failures did appeared till now.
Fixes: ebd457d55911 ("iio: light: vcnl4000 add devicetree hooks")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Angus Ainslie (Purism) angus@akkea.ca
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | drivers/iio/light/vcnl4000.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c index ca0d27b46ea2..16dacea9eadf 100644 --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -398,15 +398,15 @@ static int vcnl4000_probe(struct i2c_client *client, static const struct of_device_id vcnl_4000_of_match[] = { { .compatible = "vishay,vcnl4000", - .data = "VCNL4000", + .data = (void *)VCNL4000, }, { .compatible = "vishay,vcnl4010", - .data = "VCNL4010", + .data = (void *)VCNL4010, }, { - .compatible = "vishay,vcnl4010", - .data = "VCNL4020", + .compatible = "vishay,vcnl4020", + .data = (void *)VCNL4010, }, { .compatible = "vishay,vcnl4040", @@ -414,7 +414,7 @@ static const struct of_device_id vcnl_4000_of_match[] = { }, { .compatible = "vishay,vcnl4200", - .data = "VCNL4200", + .data = (void *)VCNL4200, }, {}, }; |
