Skip to content

Commit

Permalink
hwmon: (aspeed-pwm-tacho) Use devm_platform_ioremap_resource() in asp…
Browse files Browse the repository at this point in the history
…eed_pwm_tacho_probe()

Simplify this function implementation by using a known wrapper function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
  • Loading branch information
elfring authored and groeck committed Nov 6, 2019
1 parent 92b39ad commit 7b10e17
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/hwmon/aspeed-pwm-tacho.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,17 +891,12 @@ static int aspeed_pwm_tacho_probe(struct platform_device *pdev)
struct device_node *np, *child;
struct aspeed_pwm_tacho_data *priv;
void __iomem *regs;
struct resource *res;
struct device *hwmon;
struct clk *clk;
int ret;

np = dev->of_node;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENOENT;
regs = devm_ioremap_resource(dev, res);
regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(regs))
return PTR_ERR(regs);
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
Expand Down

0 comments on commit 7b10e17

Please sign in to comment.