Skip to content

Commit

Permalink
pwm: zx: 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 6945fe4 commit bde048e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/pwm/pwm-zx.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,14 @@ static const struct pwm_ops zx_pwm_ops = {
static int zx_pwm_probe(struct platform_device *pdev)
{
struct zx_pwm_chip *zpc;
struct resource *res;
unsigned int i;
int ret;

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

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

Expand Down

0 comments on commit bde048e

Please sign in to comment.