]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Fix warnings in leds-omap-pwm.c
authorDirk Behme <dirk.behme_at_gmail.com>
Fri, 26 Jan 2007 21:33:36 +0000 (13:33 -0800)
committerTony Lindgren <tony@atomide.com>
Fri, 26 Jan 2007 21:33:36 +0000 (13:33 -0800)
ARM: OMAP: Fix warnings in leds-omap-pwm.c:

drivers/leds/leds-omap-pwm.c: In function 'omap_pwm_led_probe':
drivers/leds/leds-omap-pwm.c:260: warning: ignoring return
value of 'class_device_create_file', declared with attribute
warn_unused_result
drivers/leds/leds-omap-pwm.c:262: warning: ignoring return
value of 'class_device_create_file', declared with attribute
warn_unused_result

Signed-off-by: Dirk Behme <dirk.behme_at_gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/leds/leds-omap-pwm.c

index b6c4d76583869ab38148ceb0bffcd0ed7c431080..6b195d6427a9ea0361ae3e8eef1e497c4bbde12a 100644 (file)
@@ -253,19 +253,30 @@ static int omap_pwm_led_probe(struct platform_device *pdev)
                if (led->blink_timer == NULL) {
                        dev_err(&pdev->dev, "failed to request blinking pwm timer\n");
                        ret = -ENODEV;
-                       goto error_blink;
+                       goto error_blink1;
                }
                omap_dm_timer_disable(led->blink_timer);
 
-               class_device_create_file(led->cdev.class_dev,
-                                        &class_device_attr_on_period);
-               class_device_create_file(led->cdev.class_dev,
-                                        &class_device_attr_off_period);
+               ret = class_device_create_file(led->cdev.class_dev,
+                                              &class_device_attr_on_period);
+               if(ret)
+                       goto error_blink2;
+
+               ret = class_device_create_file(led->cdev.class_dev,
+                                               &class_device_attr_off_period);
+               if(ret)
+                       goto error_blink3;
+
        }
 
        return 0;
 
-error_blink:
+error_blink3:
+       class_device_remove_file(led->cdev.class_dev,
+                                &class_device_attr_on_period);
+error_blink2:
+       dev_err(&pdev->dev, "failed to create device file(s)\n");
+error_blink1:
        omap_dm_timer_free(led->intensity_timer);
 error_intensity:
        led_classdev_unregister(&led->cdev);