Commit a0b336a3 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Thierry Reding
Browse files

pwm: ep93xx: Simplify using devm_pwmchip_add()



This allows to drop the platform_driver's remove function. This is the
only user of driver data so this can go away, too.

Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent ccc2df6f
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -183,27 +183,18 @@ static int ep93xx_pwm_probe(struct platform_device *pdev)
	ep93xx_pwm->chip.ops = &ep93xx_pwm_ops;
	ep93xx_pwm->chip.npwm = 1;

	ret = pwmchip_add(&ep93xx_pwm->chip);
	ret = devm_pwmchip_add(&pdev->dev, &ep93xx_pwm->chip);
	if (ret < 0)
		return ret;

	platform_set_drvdata(pdev, ep93xx_pwm);
	return 0;
}

static int ep93xx_pwm_remove(struct platform_device *pdev)
{
	struct ep93xx_pwm *ep93xx_pwm = platform_get_drvdata(pdev);

	return pwmchip_remove(&ep93xx_pwm->chip);
}

static struct platform_driver ep93xx_pwm_driver = {
	.driver = {
		.name = "ep93xx-pwm",
	},
	.probe = ep93xx_pwm_probe,
	.remove = ep93xx_pwm_remove,
};
module_platform_driver(ep93xx_pwm_driver);