Skip to contentSkip to conversation

ipmi/bt-bmc: remove redundant return value check of platform_get_resource()

PATCH Applied Wei Yongjun 2 participants 2 messages Sep 24, 2016 – Sep 30, 2016 IPMI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipmi/bt-bmc: remove redundant return value check of platform_get_resource()

From: Wei Yongjun <[email protected]>

Remove unneeded error handling on the result of a call to platform_get_resource() when the value is passed to devm_ioremap_resource().

---
 drivers/char/ipmi/bt-bmc.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/char/ipmi/bt-bmc.c +0 -5
index de64bf1..b49e613 100644
@@ -432,11 +432,6 @@ static int bt_bmc_probe(struct platform_device *pdev)
 	dev_set_drvdata(&pdev->dev, bt_bmc);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "Unable to find resources\n");
-		return -ENXIO;
-	}
-
 	bt_bmc->base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(bt_bmc->base))
 		return PTR_ERR(bt_bmc->base);
#1 lore raw

Thanks, applied.

-corey

Quoted 28 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

Remove unneeded error handling on the result of a call to platform_get_resource() when the value is passed to devm_ioremap_resource().

---
  drivers/char/ipmi/bt-bmc.c | 5 -----
  1 file changed, 5 deletions(-)
drivers/char/ipmi/bt-bmc.c +0 -5
index de64bf1..b49e613 100644
@@ -432,11 +432,6 @@ static int bt_bmc_probe(struct platform_device *pdev)
  	dev_set_drvdata(&pdev->dev, bt_bmc);
 
  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "Unable to find resources\n");
-		return -ENXIO;
-	}
-
  	bt_bmc->base = devm_ioremap_resource(&pdev->dev, res);
  	if (IS_ERR(bt_bmc->base))
  		return PTR_ERR(bt_bmc->base);