diff options
author | Antti Palosaari <crope@iki.fi> | 2014-02-12 14:59:37 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-03-28 18:10:56 -0300 |
commit | 37571b163c15831cd0a213151c21387363dbf15b (patch) | |
tree | a25db2f0066cc6eb868f6c3b06ba2ba539589154 | |
parent | 418a97cbcef9644e36d87140a6962d2cd4743e74 (diff) | |
download | linux-37571b163c15831cd0a213151c21387363dbf15b.tar.bz2 |
[media] em28xx-dvb: fix PCTV 461e tuner I2C binding
Add missing m88ts2022 module reference counts as removing that module
is not allowed when it is used by em28xx-dvb module. That same module
was not unregistered correctly, fix it too.
Error cases validated by returning errors from m88ds3103, m88ts2022
and a8293 probe().
Signed-off-by: Antti Palosaari <crope@iki.fi>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-dvb.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index 6638394b3457..d6ec572a8a6c 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c @@ -1602,6 +1602,7 @@ static int em28xx_dvb_suspend(struct em28xx *dev) em28xx_info("Suspending DVB extension"); if (dev->dvb) { struct em28xx_dvb *dvb = dev->dvb; + struct i2c_client *client = dvb->i2c_client_tuner; if (dvb->fe[0]) { ret = dvb_frontend_suspend(dvb->fe[0]); @@ -1639,6 +1640,15 @@ static int em28xx_dvb_resume(struct em28xx *dev) ret = dvb_frontend_resume(dvb->fe[1]); em28xx_info("fe1 resume %d", ret); } + /* remove I2C tuner */ + if (client) { + module_put(client->dev.driver->owner); + i2c_unregister_device(client); + } + + em28xx_unregister_dvb(dvb); + kfree(dvb); + dev->dvb = NULL; } return 0; |