summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/pvrusb2/pvrusb2-main.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-29 08:01:32 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-31 11:04:10 +0200
commit6332a6ced62ac0c9ad7617be34aa2ee4543a52ab (patch)
treec3918bd8be6a52aac3bca7956b773510a67dfa63 /drivers/media/usb/pvrusb2/pvrusb2-main.c
parentmISDN: remove unneeded mISDN_class_release() (diff)
downloadlinux-6332a6ced62ac0c9ad7617be34aa2ee4543a52ab.tar.xz
linux-6332a6ced62ac0c9ad7617be34aa2ee4543a52ab.zip
media: pvrusb2: clean up unneeded complexity in pvrusb2 class logic
The pvrusb2 driver struct class logic was dynamically creating a class that should have just been static as it did not do anything special and was only a wrapper around a stock "struct class" implementation. Clean this all up by making a static struct class and modifying the code to correctly reference it. By doing so, lots of unneeded lines of code were removed, and #ifdef logic was cleaned up so that the .c files are not cluttered up with extra complexity following the proper kernel coding style. Cc: Mike Isely <isely@pobox.com> Cc: Mauro Carvalho Chehab <mchehab@kernel.org> Cc: linux-media@vger.kernel.org Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Link: https://lore.kernel.org/r/20230329060132.2688621-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media/usb/pvrusb2/pvrusb2-main.c')
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-main.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-main.c b/drivers/media/usb/pvrusb2/pvrusb2-main.c
index ce4d566e4e5a..721dafd2c14b 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-main.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-main.c
@@ -16,9 +16,7 @@
#include "pvrusb2-context.h"
#include "pvrusb2-debug.h"
#include "pvrusb2-v4l2.h"
-#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
#include "pvrusb2-sysfs.h"
-#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
#define DRIVER_AUTHOR "Mike Isely <isely@pobox.com>"
#define DRIVER_DESC "Hauppauge WinTV-PVR-USB2 MPEG2 Encoder/Tuner"
@@ -36,10 +34,6 @@ int pvrusb2_debug = DEFAULT_DEBUG_MASK;
module_param_named(debug,pvrusb2_debug,int,S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(debug, "Debug trace mask");
-#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
-static struct pvr2_sysfs_class *class_ptr = NULL;
-#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
-
static void pvr_setup_attach(struct pvr2_context *pvr)
{
/* Create association with v4l layer */
@@ -48,9 +42,7 @@ static void pvr_setup_attach(struct pvr2_context *pvr)
/* Create association with dvb layer */
pvr2_dvb_create(pvr);
#endif
-#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
- pvr2_sysfs_create(pvr,class_ptr);
-#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
+ pvr2_sysfs_create(pvr);
}
static int pvr_probe(struct usb_interface *intf,
@@ -115,9 +107,7 @@ static int __init pvr_init(void)
return ret;
}
-#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
- class_ptr = pvr2_sysfs_class_create();
-#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
+ pvr2_sysfs_class_create();
ret = usb_register(&pvr_driver);
@@ -141,9 +131,7 @@ static void __exit pvr_exit(void)
pvr2_context_global_done();
-#ifdef CONFIG_VIDEO_PVRUSB2_SYSFS
- pvr2_sysfs_class_destroy(class_ptr);
-#endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */
+ pvr2_sysfs_class_destroy();
pvr2_trace(PVR2_TRACE_INIT,"pvr_exit complete");
}