aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-07 12:40:46 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-11 05:56:46 -0400
commitb45e34f2a6724042c068bf588322598c5ae435de (patch)
tree3dd4ba8556b266b8e0d631c1195810902f3f40d2
parent47677e51e2a4040c204d7971a5103592600185b1 (diff)
[media] em28xx-dvb: remove one level of identation at fini callback
Simplify the logic a little by removing one level of identation. Also, it only makes sense to print something if the .fini callback is actually doing something. Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/usb/em28xx/em28xx-dvb.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index cacdca3a3412..6638394b3457 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -1543,6 +1543,9 @@ static inline void prevent_sleep(struct dvb_frontend_ops *ops)
1543 1543
1544static int em28xx_dvb_fini(struct em28xx *dev) 1544static int em28xx_dvb_fini(struct em28xx *dev)
1545{ 1545{
1546 struct em28xx_dvb *dvb;
1547 struct i2c_client *client;
1548
1546 if (dev->is_audio_only) { 1549 if (dev->is_audio_only) {
1547 /* Shouldn't initialize IR for this interface */ 1550 /* Shouldn't initialize IR for this interface */
1548 return 0; 1551 return 0;
@@ -1553,35 +1556,36 @@ static int em28xx_dvb_fini(struct em28xx *dev)
1553 return 0; 1556 return 0;
1554 } 1557 }
1555 1558
1556 em28xx_info("Closing DVB extension"); 1559 if (!dev->dvb)
1560 return 0;
1557 1561
1558 if (dev->dvb) { 1562 em28xx_info("Closing DVB extension");
1559 struct em28xx_dvb *dvb = dev->dvb;
1560 struct i2c_client *client = dvb->i2c_client_tuner;
1561 1563
1562 em28xx_uninit_usb_xfer(dev, EM28XX_DIGITAL_MODE); 1564 dvb = dev->dvb;
1565 client = dvb->i2c_client_tuner;
1563 1566
1564 if (dev->disconnected) { 1567 em28xx_uninit_usb_xfer(dev, EM28XX_DIGITAL_MODE);
1565 /* We cannot tell the device to sleep
1566 * once it has been unplugged. */
1567 if (dvb->fe[0])
1568 prevent_sleep(&dvb->fe[0]->ops);
1569 if (dvb->fe[1])
1570 prevent_sleep(&dvb->fe[1]->ops);
1571 }
1572 1568
1573 /* remove I2C tuner */ 1569 if (dev->disconnected) {
1574 if (client) { 1570 /* We cannot tell the device to sleep
1575 module_put(client->dev.driver->owner); 1571 * once it has been unplugged. */
1576 i2c_unregister_device(client); 1572 if (dvb->fe[0])
1577 } 1573 prevent_sleep(&dvb->fe[0]->ops);
1574 if (dvb->fe[1])
1575 prevent_sleep(&dvb->fe[1]->ops);
1576 }
1578 1577
1579 em28xx_unregister_dvb(dvb); 1578 /* remove I2C tuner */
1580 kfree(dvb); 1579 if (client) {
1581 dev->dvb = NULL; 1580 module_put(client->dev.driver->owner);
1582 kref_put(&dev->ref, em28xx_free_device); 1581 i2c_unregister_device(client);
1583 } 1582 }
1584 1583
1584 em28xx_unregister_dvb(dvb);
1585 kfree(dvb);
1586 dev->dvb = NULL;
1587 kref_put(&dev->ref, em28xx_free_device);
1588
1585 return 0; 1589 return 0;
1586} 1590}
1587 1591