Skip to content

Commit

Permalink
pwm: berlin: Convert to devm_platform_ioremap_resource()
Browse files Browse the repository at this point in the history
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <[email protected]>
Reviewed-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
  • Loading branch information
TinyWindzz authored and thierryreding committed Dec 17, 2020
1 parent f57e7d2 commit 05baa59
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/pwm/pwm-berlin.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,13 @@ MODULE_DEVICE_TABLE(of, berlin_pwm_match);
static int berlin_pwm_probe(struct platform_device *pdev)
{
struct berlin_pwm_chip *pwm;
struct resource *res;
int ret;

pwm = devm_kzalloc(&pdev->dev, sizeof(*pwm), GFP_KERNEL);
if (!pwm)
return -ENOMEM;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pwm->base = devm_ioremap_resource(&pdev->dev, res);
pwm->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pwm->base))
return PTR_ERR(pwm->base);

Expand Down

0 comments on commit 05baa59

Please sign in to comment.