mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
pwm: ep93xx: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
committed by
Thierry Reding
parent
e3f22bc255
commit
fc0155f822
@@ -169,15 +169,13 @@ static const struct pwm_ops ep93xx_pwm_ops = {
|
|||||||
static int ep93xx_pwm_probe(struct platform_device *pdev)
|
static int ep93xx_pwm_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct ep93xx_pwm *ep93xx_pwm;
|
struct ep93xx_pwm *ep93xx_pwm;
|
||||||
struct resource *res;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ep93xx_pwm = devm_kzalloc(&pdev->dev, sizeof(*ep93xx_pwm), GFP_KERNEL);
|
ep93xx_pwm = devm_kzalloc(&pdev->dev, sizeof(*ep93xx_pwm), GFP_KERNEL);
|
||||||
if (!ep93xx_pwm)
|
if (!ep93xx_pwm)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
ep93xx_pwm->base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
ep93xx_pwm->base = devm_ioremap_resource(&pdev->dev, res);
|
|
||||||
if (IS_ERR(ep93xx_pwm->base))
|
if (IS_ERR(ep93xx_pwm->base))
|
||||||
return PTR_ERR(ep93xx_pwm->base);
|
return PTR_ERR(ep93xx_pwm->base);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user