Thermal: don't check resource with devm_ioremap_resource

devm_ioremap_resource does sanity checks on the given resource.
No need to duplicate this in the driver.

CC: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
CC: Vincenzo Frascino <vincenzo.frascino@st.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
This commit is contained in:
Zhang Rui 2013-05-16 02:16:21 +00:00
parent 253e3ae170
commit c21bec86b6
2 changed files with 3 additions and 20 deletions

View File

@ -169,21 +169,11 @@ static int armada_thermal_probe(struct platform_device *pdev)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "Failed to get platform resource\n");
return -ENODEV;
}
priv->sensor = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->sensor))
return PTR_ERR(priv->sensor);
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res) {
dev_err(&pdev->dev, "Failed to get platform resource\n");
return -ENODEV;
}
priv->control = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->control))
return PTR_ERR(priv->control);

View File

@ -118,18 +118,11 @@ static int spear_thermal_probe(struct platform_device *pdev)
return -ENOMEM;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "memory resource missing\n");
return -ENODEV;
}
/* Enable thermal sensor */
stdev->thermal_base = devm_ioremap_resource(dev, res);
if (IS_ERR(stdev->thermal_base)) {
dev_err(&pdev->dev, "ioremap failed\n");
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
stdev->thermal_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(stdev->thermal_base))
return PTR_ERR(stdev->thermal_base);
}
stdev->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(stdev->clk)) {