diff mbox series

[2/2] media: i2c: mt9p031: Drop I2C device ID table

Message ID 20241025181708.20648-3-laurent.pinchart@ideasonboard.com
State Superseded
Headers show
Series media: mt9p031: Drop legacy platform data | expand

Commit Message

Laurent Pinchart Oct. 25, 2024, 6:17 p.m. UTC
The mt9p031 driver doesn't support platform data anymore, and requires
the I2C device to be instantiated through a method that supports device
properties. As the driver lacks an ACPI device ID table, the device
matching will always go through the OF device ID table, either for OF
devices, or for ACPI devices using PRP0001. The I2C device ID table is
therefore not needed. Drop it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/i2c/mt9p031.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

Tarang Raval Oct. 28, 2024, 9:36 a.m. UTC | #1
Hi Laurent,

>The mt9p031 driver doesn't support platform data anymore, and requires
>the I2C device to be instantiated through a method that supports device
>properties. As the driver lacks an ACPI device ID table, the device
>matching will always go through the OF device ID table, either for OF
>devices, or for ACPI devices using PRP0001. The I2C device ID table is
>therefore not needed. Drop it.
>
>Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Tarang Raval <tarang.raval@siliconsignals.io>

Best Regards,
Tarang

>drivers/media/i2c/mt9p031.c | 11 +----------
> 1 file changed, 1 insertion(+), 10 deletions(-)
>
>diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
>index 70851f296142..f2f52f484044 100644
>--- a/drivers/media/i2c/mt9p031.c
>+++ b/drivers/media/i2c/mt9p031.c
>@@ -1112,7 +1112,7 @@ static int mt9p031_probe(struct i2c_client *client)
>
>        mt9p031->output_control = MT9P031_OUTPUT_CONTROL_DEF;
>        mt9p031->mode2 = MT9P031_READ_MODE_2_ROW_BLC;
>-       mt9p031->code = (uintptr_t)i2c_get_match_data(client);
>+       mt9p031->code = (uintptr_t)device_get_match_data(&client->dev);
>
>        mt9p031->regulators[0].supply = "vdd";
>        mt9p031->regulators[1].supply = "vdd_io";
>@@ -1208,14 +1208,6 @@ static void mt9p031_remove(struct i2c_client *client)
>        mutex_destroy(&mt9p031->power_lock);
> }
>
>-static const struct i2c_device_id mt9p031_id[] = {
>-       { "mt9p006", MEDIA_BUS_FMT_SGRBG12_1X12 },
>-       { "mt9p031", MEDIA_BUS_FMT_SGRBG12_1X12 },
>-       { "mt9p031m", MEDIA_BUS_FMT_Y12_1X12 },
>-       { /* sentinel */ }
>-};
>-MODULE_DEVICE_TABLE(i2c, mt9p031_id);
>-
> static const struct of_device_id mt9p031_of_match[] = {
>        { .compatible = "aptina,mt9p006", .data = (void *)MEDIA_BUS_FMT_SGRBG12_1X12 },
>        { .compatible = "aptina,mt9p031", .data = (void *)MEDIA_BUS_FMT_SGRBG12_1X12 },
>@@ -1231,7 +1223,6 @@ static struct i2c_driver mt9p031_i2c_driver = {
>        },
>        .probe          = mt9p031_probe,
>        .remove         = mt9p031_remove,
>-       .id_table       = mt9p031_id,
> };
>
> module_i2c_driver(mt9p031_i2c_driver);
>--
>Regards,
>
>Laurent Pinchart
diff mbox series

Patch

diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
index 70851f296142..f2f52f484044 100644
--- a/drivers/media/i2c/mt9p031.c
+++ b/drivers/media/i2c/mt9p031.c
@@ -1112,7 +1112,7 @@  static int mt9p031_probe(struct i2c_client *client)
 
 	mt9p031->output_control	= MT9P031_OUTPUT_CONTROL_DEF;
 	mt9p031->mode2 = MT9P031_READ_MODE_2_ROW_BLC;
-	mt9p031->code = (uintptr_t)i2c_get_match_data(client);
+	mt9p031->code = (uintptr_t)device_get_match_data(&client->dev);
 
 	mt9p031->regulators[0].supply = "vdd";
 	mt9p031->regulators[1].supply = "vdd_io";
@@ -1208,14 +1208,6 @@  static void mt9p031_remove(struct i2c_client *client)
 	mutex_destroy(&mt9p031->power_lock);
 }
 
-static const struct i2c_device_id mt9p031_id[] = {
-	{ "mt9p006", MEDIA_BUS_FMT_SGRBG12_1X12 },
-	{ "mt9p031", MEDIA_BUS_FMT_SGRBG12_1X12 },
-	{ "mt9p031m", MEDIA_BUS_FMT_Y12_1X12 },
-	{ /* sentinel */ }
-};
-MODULE_DEVICE_TABLE(i2c, mt9p031_id);
-
 static const struct of_device_id mt9p031_of_match[] = {
 	{ .compatible = "aptina,mt9p006", .data = (void *)MEDIA_BUS_FMT_SGRBG12_1X12 },
 	{ .compatible = "aptina,mt9p031", .data = (void *)MEDIA_BUS_FMT_SGRBG12_1X12 },
@@ -1231,7 +1223,6 @@  static struct i2c_driver mt9p031_i2c_driver = {
 	},
 	.probe          = mt9p031_probe,
 	.remove         = mt9p031_remove,
-	.id_table       = mt9p031_id,
 };
 
 module_i2c_driver(mt9p031_i2c_driver);