leds: leds-ss4200: fix led_classdev_unregister twice in error handling
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: NAxel Lin <axel.lin@gmail.com> Acked-by: NDave Hansen <dave@sr71.net> Signed-off-by: NRichard Purdie <rpurdie@linux.intel.com>
Showing
想要评论请 注册 或 登录