unregister_dgrp_device on a NULL pointer is a no-op, so the NULL checks in
dgrp_remove_nd() can be removed.

Signed-off-by: Cyril Roelandt <[email protected]>
---
 drivers/staging/dgrp/dgrp_specproc.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/dgrp/dgrp_specproc.c 
b/drivers/staging/dgrp/dgrp_specproc.c
index dfdaede..13c7ccf 100644
--- a/drivers/staging/dgrp/dgrp_specproc.c
+++ b/drivers/staging/dgrp/dgrp_specproc.c
@@ -777,14 +777,11 @@ static int dgrp_remove_nd(struct nd_struct *nd)
                dgrp_remove_node_class_sysfs_files(nd);
        }
 
-       if (nd->nd_mon_de)
-               unregister_dgrp_device(nd->nd_mon_de);
+       unregister_dgrp_device(nd->nd_mon_de);
 
-       if (nd->nd_ports_de)
-               unregister_dgrp_device(nd->nd_ports_de);
+       unregister_dgrp_device(nd->nd_ports_de);
 
-       if (nd->nd_dpa_de)
-               unregister_dgrp_device(nd->nd_dpa_de);
+       unregister_dgrp_device(nd->nd_dpa_de);
 
        dgrp_tty_uninit(nd);
 
-- 
1.7.10.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to