[media] pwc: Simplify leds parameter parsing
This reduces our module init to a simple usb_register() call, so
that we can make use of the new upcoming macro's for this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index a691cf8..122fbd0 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -132,7 +132,7 @@
int pwc_trace = PWC_DEBUG_LEVEL;
#endif
static int power_save = -1;
-static int led_on = 100, led_off; /* defaults to LED that is on while in use */
+static int leds[2] = { 100, 0 };
/***/
@@ -737,7 +737,7 @@
/* Turn on camera and set LEDS on */
pwc_camera_power(pdev, 1);
- pwc_set_leds(pdev, led_on, led_off);
+ pwc_set_leds(pdev, leds[0], leds[1]);
r = pwc_isoc_init(pdev);
if (r) {
@@ -1209,7 +1209,6 @@
* Initialization code & module stuff
*/
-static int leds[2] = { -1, -1 };
static unsigned int leds_nargs;
#ifdef CONFIG_USB_PWC_DEBUG
@@ -1232,11 +1231,6 @@
static int __init usb_pwc_init(void)
{
- if (leds[0] >= 0)
- led_on = leds[0];
- if (leds[1] >= 0)
- led_off = leds[1];
-
return usb_register(&pwc_driver);
}