Commit e3f22bc2 authored by Yangtao Li's avatar Yangtao Li Committed by Thierry Reding

pwm: renesas-tpu: 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 3d3a3259
...@@ -383,7 +383,6 @@ static const struct pwm_ops tpu_pwm_ops = { ...@@ -383,7 +383,6 @@ static const struct pwm_ops tpu_pwm_ops = {
static int tpu_probe(struct platform_device *pdev) static int tpu_probe(struct platform_device *pdev)
{ {
struct tpu_device *tpu; struct tpu_device *tpu;
struct resource *res;
int ret; int ret;
tpu = devm_kzalloc(&pdev->dev, sizeof(*tpu), GFP_KERNEL); tpu = devm_kzalloc(&pdev->dev, sizeof(*tpu), GFP_KERNEL);
...@@ -394,8 +393,7 @@ static int tpu_probe(struct platform_device *pdev) ...@@ -394,8 +393,7 @@ static int tpu_probe(struct platform_device *pdev)
tpu->pdev = pdev; tpu->pdev = pdev;
/* Map memory, get clock and pin control. */ /* Map memory, get clock and pin control. */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); tpu->base = devm_platform_ioremap_resource(pdev, 0);
tpu->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(tpu->base)) if (IS_ERR(tpu->base))
return PTR_ERR(tpu->base); return PTR_ERR(tpu->base);
......
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