leds: leds-ss4200: fix led_classdev_unregister twice in error handling
authorAxel Lin <axel.lin@gmail.com>
Mon, 17 May 2010 05:42:43 +0000 (13:42 +0800)
committerRichard Purdie <rpurdie@linux.intel.com>
Wed, 26 May 2010 12:07:56 +0000 (13:07 +0100)
In current implementation, if device_create_file failed in register_nasgpio_led,
led_classdev_unregister will be executed twice.
( in register_nasgpio_led it calls led_classdev_unregister before return and in nas_gpio_init out_err )

This patch fixes it by only unregistering those that were successfully registered in out_err.
( not including last failed register_nasgpio_led call )

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Dave Hansen <dave@sr71.net>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>

No differences found