Commit c189170e authored by Sakari Ailus's avatar Sakari Ailus Committed by Tony Lindgren

ARM: OMAP2: Camera: Fix v4l2 int device detach

omap24xxcam_device_unregister expected the argument to be its own
device structure but it's actually that of its slave.

Also get master from slave's structure in omap24xxcam_device_register.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent ed351ee7
......@@ -46,7 +46,7 @@
static void omap24xxcam_reset(struct omap24xxcam_device *cam);
static int omap24xxcam_sensor_if_enable(struct omap24xxcam_device *cam);
static void omap24xxcam_device_unregister(struct v4l2_int_device *ctl);
static void omap24xxcam_device_unregister(struct v4l2_int_device *s);
static int omap24xxcam_remove(struct platform_device *pdev);
/* module parameters */
......@@ -1603,10 +1603,9 @@ static int omap24xxcam_resume(struct platform_device *pdev)
*
*/
static int omap24xxcam_device_register(struct v4l2_int_device *ctl,
struct v4l2_int_device *s)
static int omap24xxcam_device_register(struct v4l2_int_device *s)
{
struct omap24xxcam_device *cam = ctl->priv;
struct omap24xxcam_device *cam = s->u.slave->master->priv;
struct video_device *vfd;
int rval;
......@@ -1681,14 +1680,14 @@ static int omap24xxcam_device_register(struct v4l2_int_device *ctl,
return 0;
err:
omap24xxcam_device_unregister(ctl);
omap24xxcam_device_unregister(s);
return rval;
}
static void omap24xxcam_device_unregister(struct v4l2_int_device *ctl)
static void omap24xxcam_device_unregister(struct v4l2_int_device *s)
{
struct omap24xxcam_device *cam = ctl->priv;
struct omap24xxcam_device *cam = s->u.slave->master->priv;
omap24xxcam_sensor_exit(cam);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment