From: Mauro Carvalho Chehab Date: Fri, 11 Sep 2020 11:14:36 +0000 (+0200) Subject: media: vidtv: fix driver unbind/remove X-Git-Tag: v5.10.7~1469^2~236 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63101b75689331c5392c9330291f57b9fd2ef94c;p=platform%2Fkernel%2Flinux-rpi.git media: vidtv: fix driver unbind/remove The current remove logic is broken and causes an OOPS. Fix it. Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/test-drivers/vidtv/vidtv_bridge.c b/drivers/media/test-drivers/vidtv/vidtv_bridge.c index 16ee23e..82e3750 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_bridge.c +++ b/drivers/media/test-drivers/vidtv/vidtv_bridge.c @@ -472,30 +472,16 @@ static int vidtv_bridge_remove(struct platform_device *pdev) mutex_destroy(&dvb->feed_lock); - for (i = 0; i < NUM_FE; ++i) - dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, - &dvb->dmx_fe[i]); - - dvb_dmxdev_release(&dvb->dmx_dev); - dvb_dmx_release(&dvb->demux); - for (i = 0; i < NUM_FE; ++i) { dvb_unregister_frontend(dvb->fe[i]); - dvb_frontend_detach(dvb->fe[i]); - } - - dvb_unregister_adapter(&dvb->adapter); - - for (i = 0; i < NUM_FE; i++) dvb_module_release(dvb->i2c_client_tuner[i]); - - for (i = 0; i < NUM_FE ; i++) dvb_module_release(dvb->i2c_client_demod[i]); + } + dvb_dmxdev_release(&dvb->dmx_dev); + dvb_dmx_release(&dvb->demux); dvb_unregister_adapter(&dvb->adapter); - i2c_del_adapter(&dvb->i2c_adapter); - return 0; } diff --git a/drivers/media/test-drivers/vidtv/vidtv_demod.c b/drivers/media/test-drivers/vidtv/vidtv_demod.c index 25c8959..d18860f 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_demod.c +++ b/drivers/media/test-drivers/vidtv/vidtv_demod.c @@ -416,8 +416,6 @@ static int vidtv_demod_i2c_remove(struct i2c_client *client) { struct vidtv_demod_state *state = i2c_get_clientdata(client); - memset(&state->frontend.ops, 0, sizeof(struct dvb_frontend_ops)); - state->frontend.demodulator_priv = NULL; kfree(state); return 0; diff --git a/drivers/media/test-drivers/vidtv/vidtv_tuner.c b/drivers/media/test-drivers/vidtv/vidtv_tuner.c index 857668f..c8e64ba 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_tuner.c +++ b/drivers/media/test-drivers/vidtv/vidtv_tuner.c @@ -402,10 +402,7 @@ static int vidtv_tuner_i2c_probe(struct i2c_client *client, static int vidtv_tuner_i2c_remove(struct i2c_client *client) { struct vidtv_tuner_dev *tuner_dev = i2c_get_clientdata(client); - struct dvb_frontend *fe = tuner_dev->fe; - memset(&fe->ops.tuner_ops, 0, sizeof(struct dvb_tuner_ops)); - fe->tuner_priv = NULL; kfree(tuner_dev); return 0;