Skip to content

Commit

Permalink
[media] em28xx-dvb: fix PCTV 461e tuner I2C binding
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: [email protected]
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
palosaari authored and mchehab committed Mar 31, 2014
1 parent 5eef220 commit a83b93a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/media/usb/em28xx/em28xx-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1630,6 +1630,7 @@ static int em28xx_dvb_resume(struct em28xx *dev)
em28xx_info("Resuming 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_resume(dvb->fe[0]);
Expand All @@ -1640,6 +1641,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;
Expand Down

0 comments on commit a83b93a

Please sign in to comment.