From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: "Linux Media Mailing List" <linux-media@vger.kernel.org>,
"Mauro Carvalho Chehab" <mchehab@infradead.org>,
"Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>,
"Shuah Khan" <shuahkh@osg.samsung.com>,
"Hans Verkuil" <hans.verkuil@cisco.com>,
"Javier Martinez Canillas" <javier@osg.samsung.com>,
"Rafael Lourenço de Lima Chehab" <chehabrafael@gmail.com>,
alsa-devel@alsa-project.org
Subject: Re: [PATCH v2] [media] media-device: use kref for media_device instance
Date: Wed, 23 Mar 2016 14:35:30 -0300 [thread overview]
Message-ID: <20160323143530.695af1c3@recife.lan> (raw)
In-Reply-To: <1547540.zgadtG4fpe@avalon>
Hi Laurent,
Thanks for reviewing it.
Em Wed, 23 Mar 2016 18:57:50 +0200
Laurent Pinchart <laurent.pinchart@ideasonboard.com> escreveu:
> On Friday 18 Mar 2016 21:42:16 Mauro Carvalho Chehab wrote:
> > Now that the media_device can be used by multiple drivers,
> > via devres, we need to be sure that it will be dropped only
> > when all drivers stop using it.
> >
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> > ---
> >
> > v2: The kref is now used only when media_device is allocated via
> > the media_device*_devress. This warrants that other drivers won't be
> > affected, and that we can keep media_device_cleanup() balanced with
> > media_device_init().
> >
> > drivers/media/media-device.c | 117 ++++++++++++++++++++++--------
> > drivers/media/usb/au0828/au0828-core.c | 3 +-
> > include/media/media-device.h | 28 ++++++++
> > sound/usb/media.c | 3 +-
> > 4 files changed, 118 insertions(+), 33 deletions(-)
> >
> > diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
> > index c32fa15cc76e..4a97d92a7e7d 100644
> > --- a/drivers/media/media-device.c
> > +++ b/drivers/media/media-device.c
> > @@ -707,11 +707,16 @@ void media_device_init(struct media_device *mdev)
> > }
> > EXPORT_SYMBOL_GPL(media_device_init);
> >
> > -void media_device_cleanup(struct media_device *mdev)
> > +static void __media_device_cleanup(struct media_device *mdev)
> > {
> > ida_destroy(&mdev->entity_internal_idx);
> > mdev->entity_internal_idx_max = 0;
> > media_entity_graph_walk_cleanup(&mdev->pm_count_walk);
> > +}
> > +
> > +void media_device_cleanup(struct media_device *mdev)
> > +{
> > + __media_device_cleanup(mdev);
> > mutex_destroy(&mdev->graph_mutex);
> > }
> > EXPORT_SYMBOL_GPL(media_device_cleanup);
> > @@ -721,6 +726,9 @@ int __must_check __media_device_register(struct
> > media_device *mdev, {
> > int ret;
> >
> > + /* Check if mdev was ever registered at all */
>
> This comment doesn't seem to apply to the next line, is it a leftover ? If so,
> please remove it.
Yes, it is a left over. I'll remove it. Thanks for noticing it.
Thanks,
Mauro
prev parent reply other threads:[~2016-03-23 17:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-19 0:42 [PATCH v2] [media] media-device: use kref for media_device instance Mauro Carvalho Chehab
2016-03-19 2:32 ` Shuah Khan
2016-03-21 11:10 ` Laurent Pinchart
2016-03-21 11:58 ` Mauro Carvalho Chehab
2016-03-21 13:52 ` Shuah Khan
2016-03-21 13:42 ` Shuah Khan
2016-03-23 9:15 ` Laurent Pinchart
2016-03-22 20:09 ` Shuah Khan
2016-03-23 16:57 ` Laurent Pinchart
2016-03-23 17:35 ` Mauro Carvalho Chehab [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160323143530.695af1c3@recife.lan \
--to=mchehab@osg.samsung.com \
--cc=alsa-devel@alsa-project.org \
--cc=chehabrafael@gmail.com \
--cc=hans.verkuil@cisco.com \
--cc=javier@osg.samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=perex@perex.cz \
--cc=shuahkh@osg.samsung.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox