Skip to contentSkip to conversation

media: v4l2-core: Replace the check for firmware registered I2C devices

PATCH In review Andy Shevchenko 1 participant 4 messages Mar 13, 2025 – May 2, 2025 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 media: v4l2-core: Replace the check for firmware registered I2C devices

Replace the check for firmware registered I²C devices as the firmware node independently on type should be retrieved via dev_fwnode().

---

v3: Use ASCII in the Subject (Hans)
v2: fixed obvious typo (media CI)

 drivers/media/v4l2-core/v4l2-i2c.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/v4l2-core/v4l2-i2c.c +2 -1
index 586c46544255..ffc64e10fcae 100644
@@ -5,6 +5,7 @@
 
 #include <linux/i2c.h>
 #include <linux/module.h>
+#include <linux/property.h>
 #include <media/v4l2-common.h>
 #include <media/v4l2-device.h>
 
@@ -24,7 +25,7 @@ void v4l2_i2c_subdev_unregister(struct v4l2_subdev *sd)
 	 * registered by us, and would not be
 	 * re-created by just probing the V4L2 driver.
 	 */
-	if (client && !client->dev.of_node && !client->dev.fwnode)
+	if (client && !dev_fwnode(&client->dev))
 		i2c_unregister_device(client);
 }
 
Signature · 1 line
2.47.2
#1 lore raw
Quoted 2 lines · Andy Shevchenko

Replace the check for firmware registered I²C devices as the firmware node independently on type should be retrieved via dev_fwnode().

Hans, are you okay with this now? Can it be applied?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 5 lines · Andy Shevchenko
Quoted 2 lines · Andy Shevchenko

Replace the check for firmware registered I²C devices as the firmware node independently on type should be retrieved via dev_fwnode().

Hans, are you okay with this now? Can it be applied?

Is this fell into cracks? Also, can somebody harvest those pretty much simple one- or so liners that I have sent last week(s)? They all basically in a way about fwnode.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 10 lines · Andy Shevchenko
Quoted 5 lines · Andy Shevchenko
Quoted 2 lines · Andy Shevchenko

Replace the check for firmware registered I²C devices as the firmware node independently on type should be retrieved via dev_fwnode().

Hans, are you okay with this now? Can it be applied?

Is this fell into cracks? Also, can somebody harvest those pretty much simple one- or so liners that I have sent last week(s)? They all basically in a way about fwnode.

Any comments? Can it be applied?

Signature · 2 lines
With Best Regards,
Andy Shevchenko