]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Thermal: don't check resource with devm_ioremap_resource
authorZhang Rui <rui.zhang@intel.com>
Thu, 16 May 2013 02:16:21 +0000 (02:16 +0000)
committerZhang Rui <rui.zhang@intel.com>
Mon, 20 May 2013 15:36:28 +0000 (23:36 +0800)
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>
drivers/thermal/armada_thermal.c
drivers/thermal/spear_thermal.c

index 5b4d75fd7b49f3f857e39dacc04488977c3d448b..54ffd64ca3f7560a3b9563bf4087c949a32cf2c6 100644 (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);
index b9e21611aece8451b8228e2f51935f8964ea5c00..9ba394ee8ec07c32ad279592e05eede7ceb6d130 100644 (file)
@@ -118,13 +118,8 @@ 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 */
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        stdev->thermal_base = devm_ioremap_resource(dev, res);
        if (IS_ERR(stdev->thermal_base)) {
                dev_err(&pdev->dev, "ioremap failed\n");