why?
because if the led_classdev_register fails we wont do gpio free
because using devm_ functions, there is no need for error paths
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
struct s3c24xx_gpio_led *led = pdev_to_gpio(dev);
led_classdev_unregister(&led->cdev);
- gpio_free(led->pdata->gpio);
return 0;
}
led->pdata = pdata;
- ret = gpio_request(pdata->gpio, "S3C24XX_LED");
+ ret = devm_gpio_request(&dev->dev, pdata->gpio, "S3C24XX_LED");
if (ret < 0)
return ret;