From: Dirk Behme Date: Fri, 26 Jan 2007 21:33:36 +0000 (-0800) Subject: ARM: OMAP: Fix warnings in leds-omap-pwm.c X-Git-Tag: v2.6.21-omap1~139 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e1424aef5cf9ef6a39c69efe1de1f0a75d9b709f;p=linux-2.6-omap-h63xx.git ARM: OMAP: Fix warnings in leds-omap-pwm.c 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 Signed-off-by: Tony Lindgren --- diff --git a/drivers/leds/leds-omap-pwm.c b/drivers/leds/leds-omap-pwm.c index b6c4d765838..6b195d6427a 100644 --- a/drivers/leds/leds-omap-pwm.c +++ b/drivers/leds/leds-omap-pwm.c @@ -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);