Skip to content

Commit 2a21d85

Browse files
YueHaibingcminyard
authored andcommitted
ipmi: bt-bmc: use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Signed-off-by: YueHaibing <[email protected]> Message-Id: <[email protected]> Reviewed-by: Cédric Le Goater <[email protected]> Signed-off-by: Corey Minyard <[email protected]>
1 parent 8ee7b48 commit 2a21d85

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/char/ipmi/bt-bmc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,15 +444,13 @@ static int bt_bmc_probe(struct platform_device *pdev)
444444

445445
bt_bmc->map = syscon_node_to_regmap(pdev->dev.parent->of_node);
446446
if (IS_ERR(bt_bmc->map)) {
447-
struct resource *res;
448447
void __iomem *base;
449448

450449
/*
451450
* Assume it's not the MFD-based devicetree description, in
452451
* which case generate a regmap ourselves
453452
*/
454-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
455-
base = devm_ioremap_resource(&pdev->dev, res);
453+
base = devm_platform_ioremap_resource(pdev, 0);
456454
if (IS_ERR(base))
457455
return PTR_ERR(base);
458456

0 commit comments

Comments
 (0)