]> Pileus Git - ~andy/linux/blobdiff - drivers/thermal/kirkwood_thermal.c
Merge branches 'misc', 'drv_cleanup', 'devm-cleanup' and 'ti-soc' of .git into next
[~andy/linux] / drivers / thermal / kirkwood_thermal.c
index 61bbc2605b0251afc7c44417a044cec14bf5c973..3b034a0dfc9426ad48018699772fc024163156b6 100644 (file)
@@ -75,16 +75,11 @@ static int kirkwood_thermal_probe(struct platform_device *pdev)
        struct kirkwood_thermal_priv *priv;
        struct resource *res;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(&pdev->dev, "Failed to get platform resource\n");
-               return -ENODEV;
-       }
-
        priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
 
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        priv->sensor = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(priv->sensor))
                return PTR_ERR(priv->sensor);
@@ -108,7 +103,6 @@ static int kirkwood_thermal_exit(struct platform_device *pdev)
                platform_get_drvdata(pdev);
 
        thermal_zone_device_unregister(kirkwood_thermal);
-       platform_set_drvdata(pdev, NULL);
 
        return 0;
 }