From: Wu Guoxing Date: Thu, 21 Jun 2012 08:11:34 +0000 (+0800) Subject: ENGR00210937:v4l2: kernel dump caused by remove mxc_v4l2_capture X-Git-Tag: v3.0.35-fsl~872 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=49829bdce513b0a4d9f185945e4d230f911a1143;p=karo-tx-linux.git ENGR00210937:v4l2: kernel dump caused by remove mxc_v4l2_capture kernel dump when do "modprobe -r mxc_v4l2_capture" this is caused by unregister wrong v4l2 int device when rmmod Signed-off-by: Wu Guoxing --- diff --git a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c index dcfc86800940..5bd4886fec02 100644 --- a/drivers/media/video/mxc/capture/mxc_v4l2_capture.c +++ b/drivers/media/video/mxc/capture/mxc_v4l2_capture.c @@ -176,15 +176,6 @@ static struct v4l2_int_master mxc_v4l2_master = { .detach = mxc_v4l2_master_detach, }; -static struct v4l2_int_device mxc_v4l2_int_device = { - .module = THIS_MODULE, - .name = "mxc_v4l2_cap", - .type = v4l2_int_type_master, - .u = { - .master = &mxc_v4l2_master, - }, -}; - /*************************************************************************** * Functions for handling Frame buffers. **************************************************************************/ @@ -2678,7 +2669,6 @@ static int mxc_v4l2_probe(struct platform_device *pdev) /* Set up the v4l2 device and register it*/ cam->self->priv = cam; - /* This function contains a bug that won't let this be rmmod'd. */ v4l2_int_device_register(cam->self); /* register v4l video device */ @@ -2727,7 +2717,7 @@ static int mxc_v4l2_remove(struct platform_device *pdev) &dev_attr_fsl_v4l2_overlay_property); pr_info("V4L2 freeing image input device\n"); - v4l2_int_device_unregister(&mxc_v4l2_int_device); + v4l2_int_device_unregister(cam->self); video_unregister_device(cam->video_dev); mxc_free_frame_buf(cam);