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:
Родитель
253e3ae170
Коммит
c21bec86b6
|
@ -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);
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче