diff mbox series

[v8-rc1,10/20] squash! max9286: Move multi-device workarounds out of upstream

Message ID 20200416104052.2643098-11-jacopo+renesas@jmondi.org (mailing list archive)
State New
Delegated to: Kieran Bingham
Headers show
Series GMSL: max9286-v8-rc1 + RDAMC20-v8 | expand

Commit Message

Jacopo Mondi April 16, 2020, 10:40 a.m. UTC
From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

 - Move multi-device workarounds out of upstream driver
---
 drivers/media/i2c/max9286.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index 8f7e8928af56..3fd70ddbcce8 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -911,12 +911,6 @@  static int max9286_setup(struct max9286_priv *priv)
 	return 0;
 }
 
-static const struct of_device_id max9286_dt_ids[] = {
-	{ .compatible = "maxim,max9286" },
-	{},
-};
-MODULE_DEVICE_TABLE(of, max9286_dt_ids);
-
 static void max9286_gpio_set(struct gpio_chip *chip,
 			     unsigned int offset, int value)
 {
@@ -976,10 +970,6 @@  static int max9286_init(struct device *dev)
 	struct i2c_client *client;
 	int ret;
 
-	/* Skip non-max9286 devices. */
-	if (!dev->of_node || !of_match_node(max9286_dt_ids, dev->of_node))
-		return 0;
-
 	client = to_i2c_client(dev);
 	priv = i2c_get_clientdata(client);
 
@@ -1256,6 +1246,12 @@  static int max9286_remove(struct i2c_client *client)
 	return 0;
 }
 
+static const struct of_device_id max9286_dt_ids[] = {
+	{ .compatible = "maxim,max9286" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, max9286_dt_ids);
+
 static const struct i2c_device_id max9286_id[] = {
 	{ "max9286", 0 },
 	{ }