Commit 3151b130 authored by Yangtao Li's avatar Yangtao Li Committed by Thierry Reding

pwm: clps711x: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: default avatarYangtao Li <tiny.windzz@gmail.com>
Reviewed-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 6e0301e7
...@@ -113,14 +113,12 @@ static struct pwm_device *clps711x_pwm_xlate(struct pwm_chip *chip, ...@@ -113,14 +113,12 @@ static struct pwm_device *clps711x_pwm_xlate(struct pwm_chip *chip,
static int clps711x_pwm_probe(struct platform_device *pdev) static int clps711x_pwm_probe(struct platform_device *pdev)
{ {
struct clps711x_chip *priv; struct clps711x_chip *priv;
struct resource *res;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->pmpcon = devm_platform_ioremap_resource(pdev, 0);
priv->pmpcon = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->pmpcon)) if (IS_ERR(priv->pmpcon))
return PTR_ERR(priv->pmpcon); return PTR_ERR(priv->pmpcon);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment