linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Samsung i2c subdev drivers that set sd->name
@ 2013-06-24  8:54 Hans Verkuil
  2013-06-25 16:55 ` Sylwester Nawrocki
  0 siblings, 1 reply; 13+ messages in thread
From: Hans Verkuil @ 2013-06-24  8:54 UTC (permalink / raw)
  To: Sylwester Nawrocki; +Cc: linux-media

Hi Sylwester,

It came to my attention that several i2c subdev drivers overwrite the sd->name
as set by v4l2_i2c_subdev_init with a custom name.

This is wrong if it is possible that there are multiple identical sensors in
the system. The sd->name must be unique since it is used to prefix kernel
messages etc, so you have to be able to tell the sensor devices apart.

It concerns the following Samsung-contributed drivers:

drivers/media/i2c/s5k4ecgx.c:   strlcpy(sd->name, S5K4ECGX_DRIVER_NAME, sizeof(sd->name));
drivers/media/i2c/s5c73m3/s5c73m3-core.c:       strlcpy(sd->name, "S5C73M3", sizeof(sd->name));
drivers/media/i2c/s5c73m3/s5c73m3-core.c:       strcpy(oif_sd->name, "S5C73M3-OIF");
drivers/media/i2c/sr030pc30.c:  strcpy(sd->name, MODULE_NAME);
drivers/media/i2c/noon010pc30.c:        strlcpy(sd->name, MODULE_NAME, sizeof(sd->name));
drivers/media/i2c/m5mols/m5mols_core.c: strlcpy(sd->name, MODULE_NAME, sizeof(sd->name));
drivers/media/i2c/s5k6aa.c:     strlcpy(sd->name, DRIVER_NAME, sizeof(sd->name));

If there can be only one sensor (because it is integrated in the SoC),
then there is no problem with doing this. But it is not obvious to me
which of these drivers are for integrated systems, and which aren't.

I can make patches for those that need to be fixed if you can tell me
which drivers are affected.

Regards,

	Hans

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

end of thread, other threads:[~2013-07-10 23:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-24  8:54 Samsung i2c subdev drivers that set sd->name Hans Verkuil
2013-06-25 16:55 ` Sylwester Nawrocki
2013-06-26  9:00   ` Sakari Ailus
2013-06-27  6:43     ` Hans Verkuil
2013-06-27  9:53       ` Sylwester Nawrocki
2013-07-03 22:49         ` Laurent Pinchart
2013-07-04 11:13           ` Hans Verkuil
2013-07-04 20:19             ` Sylwester Nawrocki
2013-07-05 11:30               ` Laurent Pinchart
2013-07-06 20:50                 ` Sylwester Nawrocki
2013-07-10 22:19                   ` Sakari Ailus
2013-07-10 23:28                     ` Laurent Pinchart
2013-07-10 23:27                   ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).