pwm: sifive: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
parent
cecccd8d4a
commit
96cfceba39
|
@ -232,7 +232,6 @@ static int pwm_sifive_probe(struct platform_device *pdev)
|
|||
struct device *dev = &pdev->dev;
|
||||
struct pwm_sifive_ddata *ddata;
|
||||
struct pwm_chip *chip;
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
|
||||
|
@ -248,8 +247,7 @@ static int pwm_sifive_probe(struct platform_device *pdev)
|
|||
chip->base = -1;
|
||||
chip->npwm = 4;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
ddata->regs = devm_ioremap_resource(dev, res);
|
||||
ddata->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(ddata->regs))
|
||||
return PTR_ERR(ddata->regs);
|
||||
|
||||
|
|
Loading…
Reference in New Issue