mbox series

[0/2] Don't set bus info for test drivers

Message ID 20231129141545.87461-1-sakari.ailus@linux.intel.com
Headers show
Series Don't set bus info for test drivers | expand

Message

Sakari Ailus Nov. 29, 2023, 2:15 p.m. UTC
Hi folks,

As it's no longer needed to set the bus_info field for querycap or MC
device in drivers, drop this from vimc and vivid drivers.

Sakari Ailus (2):
  media: vivid: Don't explicitly set bus_info
  media: vimc: Don't explicitly set bus_info

 drivers/media/test-drivers/vimc/vimc-capture.c | 2 --
 drivers/media/test-drivers/vimc/vimc-core.c    | 2 --
 drivers/media/test-drivers/vivid/vivid-core.c  | 4 ----
 3 files changed, 8 deletions(-)

Comments

Sakari Ailus Nov. 29, 2023, 3:49 p.m. UTC | #1
Hi Hans,

Thanks for the review.

On Wed, Nov 29, 2023 at 03:26:00PM +0100, Hans Verkuil wrote:
> On 29/11/2023 15:15, Sakari Ailus wrote:
> > The bus_info field in both struct media_device and struct v4l2_capability
> > is assigned by the framework for platform devices. Do not set it in the
> > driver.
> 
> That doesn't work for vivid. The problem is that if you create multiple instances
> (e.g. modprobe vivid n_devs=2), then each instance will report "platform:vivid.0"
> as bus info, but they must give different bus_info names since that has to be unique.
> 
> It should be fine for vimc, though, since that's just a single instance.
> 
> So vivid is an exception to the rule. Rather than removing these snprintf lines,
> adding a comment might be better.

Sounds reasonable. I'll do this in v2.

> 
> For the record: I tried exactly the same thing myself some time ago, and then
> discovered that that didn't fly.