siano: get rid of an unused return code for debugfs register
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 8 Aug 2018 13:54:49 +0000 (09:54 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 8 Aug 2018 14:57:14 +0000 (10:57 -0400)
The siano's debugfs register logic is optional: it should be ok
if it fails. So, no need to check if debufs register succeeded.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/common/siano/smsdvb-debugfs.c
drivers/media/common/siano/smsdvb.h

index 40891f4..c95d458 100644 (file)
@@ -500,7 +500,7 @@ void smsdvb_debugfs_release(struct smsdvb_client_t *client)
        client->debugfs = NULL;
 }
 
-int smsdvb_debugfs_register(void)
+void smsdvb_debugfs_register(void)
 {
        struct dentry *d;
 
@@ -517,15 +517,15 @@ int smsdvb_debugfs_register(void)
        d = debugfs_create_dir("smsdvb", usb_debug_root);
        if (IS_ERR_OR_NULL(d)) {
                pr_err("Couldn't create sysfs node for smsdvb\n");
-               return PTR_ERR(d);
-       } else {
-               smsdvb_debugfs_usb_root = d;
+               return;
        }
-       return 0;
+       smsdvb_debugfs_usb_root = d;
 }
 
 void smsdvb_debugfs_unregister(void)
 {
+       if (!smsdvb_debugfs_usb_root)
+               return;
        debugfs_remove_recursive(smsdvb_debugfs_usb_root);
        smsdvb_debugfs_usb_root = NULL;
 }
index b15754d..befeb98 100644 (file)
@@ -107,7 +107,7 @@ struct RECEPTION_STATISTICS_PER_SLICES_S {
 
 int smsdvb_debugfs_create(struct smsdvb_client_t *client);
 void smsdvb_debugfs_release(struct smsdvb_client_t *client);
-int smsdvb_debugfs_register(void);
+void smsdvb_debugfs_register(void);
 void smsdvb_debugfs_unregister(void);
 
 #else
@@ -119,10 +119,7 @@ static inline int smsdvb_debugfs_create(struct smsdvb_client_t *client)
 
 static inline void smsdvb_debugfs_release(struct smsdvb_client_t *client) {}
 
-static inline int smsdvb_debugfs_register(void)
-{
-       return 0;
-};
+static inline void smsdvb_debugfs_register(void) {}
 
 static inline void smsdvb_debugfs_unregister(void) {};