Skip to content

Commit

Permalink
pwm: mtk-disp: 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: Matthias Brugger <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
  • Loading branch information
TinyWindzz authored and thierryreding committed Dec 17, 2020
1 parent 5bec839 commit 6e0301e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/pwm/pwm-mtk-disp.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ static const struct pwm_ops mtk_disp_pwm_ops = {
static int mtk_disp_pwm_probe(struct platform_device *pdev)
{
struct mtk_disp_pwm *mdp;
struct resource *r;
int ret;

mdp = devm_kzalloc(&pdev->dev, sizeof(*mdp), GFP_KERNEL);
Expand All @@ -181,8 +180,7 @@ static int mtk_disp_pwm_probe(struct platform_device *pdev)

mdp->data = of_device_get_match_data(&pdev->dev);

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

Expand Down

0 comments on commit 6e0301e

Please sign in to comment.