Message ID | 20200213102135.2179-1-kieran.bingham+renesas@ideasonboard.com (mailing list archive) |
---|---|
State | New |
Delegated to: | Kieran Bingham |
Headers | show |
Series | max9286: balance v4l2_async refcnting | expand |
On 13/02/2020 10:21, Kieran Bingham wrote: > When we add fwnodes to V4L2 notifiers through > v4l2_async_notifier_add_subdev they are stored internally in V4L2 core, > and have a reference count released upon any call to > v4l2_async_notifier_cleanup(). > > Ensure that any source successfully added to a notifier gets its fwnode > reference count increased accordingly. > > Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> > --- > drivers/media/i2c/max9286.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c > index f3311210a666..62615e6ab710 100644 > --- a/drivers/media/i2c/max9286.c > +++ b/drivers/media/i2c/max9286.c > @@ -665,6 +665,11 @@ static int max9286_v4l2_async_register(struct max9286_priv *priv) > v4l2_async_notifier_cleanup(&priv->notifier); > return ret; > } > + > + /* Balance the refernce counting handled through I've correctly moved this to a new line and fixed up the reference spelling :) > + * v4l2_async_notifier_cleanup() > + */ > + fwnode_handle_get(source->fwnode); > } > > priv->notifier.ops = &max9286_notify_ops; >
Hi Kieran! On Thu, Feb 13, 2020 at 01:06:31PM +0000, Kieran Bingham wrote: > On 13/02/2020 10:21, Kieran Bingham wrote: > > When we add fwnodes to V4L2 notifiers through > > v4l2_async_notifier_add_subdev they are stored internally in V4L2 core, > > and have a reference count released upon any call to > > v4l2_async_notifier_cleanup(). > > > > Ensure that any source successfully added to a notifier gets its fwnode > > reference count increased accordingly. > > > > Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> > > --- > > drivers/media/i2c/max9286.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c > > index f3311210a666..62615e6ab710 100644 > > --- a/drivers/media/i2c/max9286.c > > +++ b/drivers/media/i2c/max9286.c > > @@ -665,6 +665,11 @@ static int max9286_v4l2_async_register(struct max9286_priv *priv) > > v4l2_async_notifier_cleanup(&priv->notifier); > > return ret; > > } > > + > > + /* Balance the refernce counting handled through > > I've correctly moved this to a new line and fixed up the reference > spelling :) Good, thanks! I think you could squash all of these in the next max9286 iteration! Acked-by: Jacopo Mondi <jacopo@jmondi.org> Thanks j > > > + * v4l2_async_notifier_cleanup() > > + */ > > + fwnode_handle_get(source->fwnode); > > } > > > > priv->notifier.ops = &max9286_notify_ops; > > >
On 13/02/2020 13:11, Jacopo Mondi wrote: > Hi Kieran! > > On Thu, Feb 13, 2020 at 01:06:31PM +0000, Kieran Bingham wrote: >> On 13/02/2020 10:21, Kieran Bingham wrote: >>> When we add fwnodes to V4L2 notifiers through >>> v4l2_async_notifier_add_subdev they are stored internally in V4L2 core, >>> and have a reference count released upon any call to >>> v4l2_async_notifier_cleanup(). >>> >>> Ensure that any source successfully added to a notifier gets its fwnode >>> reference count increased accordingly. >>> >>> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> >>> --- >>> drivers/media/i2c/max9286.c | 5 +++++ >>> 1 file changed, 5 insertions(+) >>> >>> diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c >>> index f3311210a666..62615e6ab710 100644 >>> --- a/drivers/media/i2c/max9286.c >>> +++ b/drivers/media/i2c/max9286.c >>> @@ -665,6 +665,11 @@ static int max9286_v4l2_async_register(struct max9286_priv *priv) >>> v4l2_async_notifier_cleanup(&priv->notifier); >>> return ret; >>> } >>> + >>> + /* Balance the refernce counting handled through >> >> I've correctly moved this to a new line and fixed up the reference >> spelling :) > > Good, thanks! > > I think you could squash all of these in the next max9286 iteration! > > Acked-by: Jacopo Mondi <jacopo@jmondi.org> Thankyou, I'll squash and rebase to linux-media/master branch! \o/ -- Kieran > > Thanks > j >> >>> + * v4l2_async_notifier_cleanup() >>> + */ >>> + fwnode_handle_get(source->fwnode); >>> } >>> >>> priv->notifier.ops = &max9286_notify_ops; >>> >>
diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index f3311210a666..62615e6ab710 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -665,6 +665,11 @@ static int max9286_v4l2_async_register(struct max9286_priv *priv) v4l2_async_notifier_cleanup(&priv->notifier); return ret; } + + /* Balance the refernce counting handled through + * v4l2_async_notifier_cleanup() + */ + fwnode_handle_get(source->fwnode); } priv->notifier.ops = &max9286_notify_ops;
When we add fwnodes to V4L2 notifiers through v4l2_async_notifier_add_subdev they are stored internally in V4L2 core, and have a reference count released upon any call to v4l2_async_notifier_cleanup(). Ensure that any source successfully added to a notifier gets its fwnode reference count increased accordingly. Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> --- drivers/media/i2c/max9286.c | 5 +++++ 1 file changed, 5 insertions(+)