[media] ddbridge: remove unneeded check before dvb_unregister_device()
authorMarkus Elfring <elfring@users.sourceforge.net>
Sun, 30 Nov 2014 21:50:20 +0000 (18:50 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 4 Dec 2014 17:28:52 +0000 (15:28 -0200)
The dvb_unregister_device() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/pci/ddbridge/ddbridge-core.c

index c82e855a0814c87cf03782f1521915276686569a..9e3492e2076609ff0339484186422980cee3d920 100644 (file)
@@ -1118,8 +1118,7 @@ static void ddb_ports_detach(struct ddb *dev)
                        dvb_input_detach(port->input[1]);
                        break;
                case DDB_PORT_CI:
-                       if (port->output->dev)
-                               dvb_unregister_device(port->output->dev);
+                       dvb_unregister_device(port->output->dev);
                        if (port->en) {
                                ddb_input_stop(port->input[0]);
                                ddb_output_stop(port->output);