Re: [PATCH v2 23/29] media: vimc: Release resources on media device release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Laurent,

On Wed, Feb 21, 2024 at 01:02:22PM +0200, Laurent Pinchart wrote:
> On Wed, Feb 21, 2024 at 10:53:43AM +0000, Sakari Ailus wrote:
> > Hi Hans,
> > 
> > On Mon, Feb 05, 2024 at 04:02:24PM +0100, Hans Verkuil wrote:
> > > On 20/12/2023 11:37, Sakari Ailus wrote:
> > > > Release all the resources when the media device is related, moving away
> > 
> > s/related/released/
> > 
> > > > form the struct v4l2_device used for that purpose.
> > > 
> > > form -> from
> > 
> > Yes.
> > 
> > > 
> > > > 
> > > > Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
> > > > ---
> > > >  drivers/media/test-drivers/vimc/vimc-core.c | 15 +++++++++------
> > > >  1 file changed, 9 insertions(+), 6 deletions(-)
> > > > 
> > > > diff --git a/drivers/media/test-drivers/vimc/vimc-core.c b/drivers/media/test-drivers/vimc/vimc-core.c
> > > > index af127476e920..3e59f8c256c7 100644
> > > > --- a/drivers/media/test-drivers/vimc/vimc-core.c
> > > > +++ b/drivers/media/test-drivers/vimc/vimc-core.c
> > > > @@ -264,13 +264,12 @@ static int vimc_add_subdevs(struct vimc_device *vimc)
> > > >  	return 0;
> > > >  }
> > > >  
> > > > -static void vimc_v4l2_dev_release(struct v4l2_device *v4l2_dev)
> > > > +static void vimc_mdev_release(struct media_device *mdev)
> > > >  {
> > > >  	struct vimc_device *vimc =
> > > > -		container_of(v4l2_dev, struct vimc_device, v4l2_dev);
> > > > +		container_of_const(mdev, struct vimc_device, mdev);
> > > 
> > > Why this change?
> > 
> > I changed the line already. There's no reason to continue using
> > container_of() instead of container_of_const() that takes const-ness into
> > account, too.
> 
> It should then be at least mentioned in the commit message.

I can add that.

> 
> Any plan to switch to container_of_const() globally in the subsystem ?

This should of course be done.

I can post patches at some point unless someone gets there first. I can't
promise a quick schedule though.

-- 
Regards,

Sakari Ailus




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux