[PATCH 1/3] leds: leds-mc13783: Prepare driver to support MC13892 LEDs

Philippe Rétornaz philippe.retornaz at epfl.ch
Mon Jun 3 12:35:24 EDT 2013


Hi

> @@ -341,51 +362,55 @@ static int mc13783_led_probe(struct platform_device *pdev)
>
>   err_register:
>   	for (i = i - 1; i >= 0; i--) {
> -		led_classdev_unregister(&led[i].cdev);
>   		cancel_work_sync(&led[i].work);
> +		led_classdev_unregister(&led[i].cdev);
>   	}
>
>   	return ret;
>   }
>
> +static int mc13xxx_led_remove(struct platform_device *pdev)
(..)
>
>   	for (i = 0; i < pdata->num_leds; i++) {
> -		led_classdev_unregister(&led[i].cdev);
>   		cancel_work_sync(&led[i].work);
> +		led_classdev_unregister(&led[i].cdev);
>   	}
>


Why changing the order ?

Thanks,

Philippe



More information about the linux-arm-kernel mailing list