Re: [RFC v4 19/21] omap3isp: Allocate the media device dynamically

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

 



Hi Hans,

On Tue, Nov 22, 2016 at 11:05:49AM +0100, Hans Verkuil wrote:
...
> >@@ -2183,7 +2185,7 @@ static int isp_subdev_notifier_complete(struct v4l2_async_notifier *async)
> > 	if (ret < 0)
> > 		return ret;
> >
> >-	return media_device_register(&isp->media_dev);
> >+	return media_device_register(isp->media_dev);
> 
> I wonder if this is correct. Usually if the register fails, then the
> release/delete function
> has to be called explicitly. That doesn't happen here.

This patch is really about making the media_dev a pointer in struct
omap3isp_device. Currently the cleanup takes place when the device is
unbound. That's perhaps not ideal but on the other hand optimising error
handling is often just not worth it.

Improvements could be done how the async framework handles errors but that
shouldn't be in the scope of this patchset.

> 
> E.g. from adv7604.c:
> 
> static int adv76xx_registered(struct v4l2_subdev *sd)
> {
>         struct adv76xx_state *state = to_state(sd);
>         int err;
> 
>         err = cec_register_adapter(state->cec_adap);
>         if (err)
>                 cec_delete_adapter(state->cec_adap);
>         return err;
> }

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@xxxxxx	XMPP: sailus@xxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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