[PATCH 2/7] led: pca955x: fix probing from device tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



dev->id_entry is not populated for devices probed from the device
tree. It was used unconditionally however. Use device_get_match_data
instead to support device tree probing.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 drivers/led/led-pca955x.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/led/led-pca955x.c b/drivers/led/led-pca955x.c
index 27fefce8d524..f89fcbfba5ac 100644
--- a/drivers/led/led-pca955x.c
+++ b/drivers/led/led-pca955x.c
@@ -349,8 +349,11 @@ static int led_pca955x_probe(struct device_d *dev)
 	struct i2c_client *client;
 	int err;
 	struct pca955x_platform_data *pdata;
+	enum pca955x_type type;
 
-	chip = &pca955x_chipdefs[dev->id_entry->driver_data];
+	type = (enum pca955x_type)device_get_match_data(dev);
+
+	chip = &pca955x_chipdefs[type];
 	client = to_i2c_client(dev);
 
 	/* Make sure the slave address / chip type combo given is possible */
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux