Skip to content

Commit

Permalink
pwm: lpc32xx: 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 537fe68 commit fd7c575
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/pwm/pwm-lpc32xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,14 @@ static const struct pwm_ops lpc32xx_pwm_ops = {
static int lpc32xx_pwm_probe(struct platform_device *pdev)
{
struct lpc32xx_pwm_chip *lpc32xx;
struct resource *res;
int ret;
u32 val;

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

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

Expand Down

0 comments on commit fd7c575

Please sign in to comment.