OSDN Git Service

Merge branch 'next' into for-linus
[uclinux-h8/linux.git] / drivers / input / joystick / xpad.c
index fc55f0d..3aa2f3f 100644 (file)
@@ -886,8 +886,8 @@ static void xpad_led_set(struct led_classdev *led_cdev,
 
 static int xpad_led_probe(struct usb_xpad *xpad)
 {
-       static atomic_t led_seq = ATOMIC_INIT(0);
-       long led_no;
+       static atomic_t led_seq = ATOMIC_INIT(-1);
+       unsigned long led_no;
        struct xpad_led *led;
        struct led_classdev *led_cdev;
        int error;
@@ -899,9 +899,9 @@ static int xpad_led_probe(struct usb_xpad *xpad)
        if (!led)
                return -ENOMEM;
 
-       led_no = (long)atomic_inc_return(&led_seq) - 1;
+       led_no = atomic_inc_return(&led_seq);
 
-       snprintf(led->name, sizeof(led->name), "xpad%ld", led_no);
+       snprintf(led->name, sizeof(led->name), "xpad%lu", led_no);
        led->xpad = xpad;
 
        led_cdev = &led->led_cdev;