aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pwc
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-01-10 15:51:12 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-16 08:28:13 -0500
commitc24e13713762a30f22468ac2c3d053abacb7672d (patch)
treed1f3d2c2138cd1183d7884f49a27cd2e8df380f3 /drivers/media/video/pwc
parenta081c3400ff2695244714293f5f6a4675c3a9493 (diff)
[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>
Diffstat (limited to 'drivers/media/video/pwc')
-rw-r--r--drivers/media/video/pwc/pwc-if.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index a691cf821747..122fbd0081eb 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -132,7 +132,7 @@ static struct usb_driver pwc_driver = {
132 int pwc_trace = PWC_DEBUG_LEVEL; 132 int pwc_trace = PWC_DEBUG_LEVEL;
133#endif 133#endif
134static int power_save = -1; 134static int power_save = -1;
135static int led_on = 100, led_off; /* defaults to LED that is on while in use */ 135static int leds[2] = { 100, 0 };
136 136
137/***/ 137/***/
138 138
@@ -737,7 +737,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
737 737
738 /* Turn on camera and set LEDS on */ 738 /* Turn on camera and set LEDS on */
739 pwc_camera_power(pdev, 1); 739 pwc_camera_power(pdev, 1);
740 pwc_set_leds(pdev, led_on, led_off); 740 pwc_set_leds(pdev, leds[0], leds[1]);
741 741
742 r = pwc_isoc_init(pdev); 742 r = pwc_isoc_init(pdev);
743 if (r) { 743 if (r) {
@@ -1209,7 +1209,6 @@ static void usb_pwc_disconnect(struct usb_interface *intf)
1209 * Initialization code & module stuff 1209 * Initialization code & module stuff
1210 */ 1210 */
1211 1211
1212static int leds[2] = { -1, -1 };
1213static unsigned int leds_nargs; 1212static unsigned int leds_nargs;
1214 1213
1215#ifdef CONFIG_USB_PWC_DEBUG 1214#ifdef CONFIG_USB_PWC_DEBUG
@@ -1232,11 +1231,6 @@ MODULE_VERSION( PWC_VERSION );
1232 1231
1233static int __init usb_pwc_init(void) 1232static int __init usb_pwc_init(void)
1234{ 1233{
1235 if (leds[0] >= 0)
1236 led_on = leds[0];
1237 if (leds[1] >= 0)
1238 led_off = leds[1];
1239
1240 return usb_register(&pwc_driver); 1234 return usb_register(&pwc_driver);
1241} 1235}
1242 1236