public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] media: v4l2-core: v4l2-i2c: Fix default device name
@ 2022-07-18 12:01 Alexander Stein
  2022-07-18 18:39 ` Sakari Ailus
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Stein @ 2022-07-18 12:01 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Alexander Stein, Sakari Ailus,
	Hans Verkuil
  Cc: linux-media

Documentation to v4l2_i2c_subdev_set_name says I²C device name if
devname parameter is NULL. But instead the I²C driver name is assigned.
Fix this by actually using the i2c_client->name for the subdev name.

Fixes: 0658293012af ("media: v4l: subdev: Add a function to set an I²C sub-device's name")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
Having a sensor node in DT with compatible = "ovti,ov9281" the subdev
name is "ov9282" without this patch. With this patch applied it is
"ov9281". The i2c_client->name is "ov9281" in every case.

 drivers/media/v4l2-core/v4l2-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/v4l2-core/v4l2-i2c.c b/drivers/media/v4l2-core/v4l2-i2c.c
index b4acca75644b..90c3c799317a 100644
--- a/drivers/media/v4l2-core/v4l2-i2c.c
+++ b/drivers/media/v4l2-core/v4l2-i2c.c
@@ -33,7 +33,7 @@ void v4l2_i2c_subdev_set_name(struct v4l2_subdev *sd,
 			      const char *devname, const char *postfix)
 {
 	if (!devname)
-		devname = client->dev.driver->name;
+		devname = client->name;
 	if (!postfix)
 		postfix = "";
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-07-22  7:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-18 12:01 [PATCH 1/1] media: v4l2-core: v4l2-i2c: Fix default device name Alexander Stein
2022-07-18 18:39 ` Sakari Ailus
2022-07-20  7:54   ` Alexander Stein
2022-07-22  6:28     ` Sakari Ailus
2022-07-22  7:09       ` Alexander Stein
2022-07-22  7:31         ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox