aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/dove_thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/dove_thermal.c')
-rw-r--r--drivers/thermal/dove_thermal.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
index d5c029f9344d..828f5e345c30 100644
--- a/drivers/thermal/dove_thermal.c
+++ b/drivers/thermal/dove_thermal.c
@@ -134,25 +134,16 @@ static int dove_thermal_probe(struct platform_device *pdev)
134 struct resource *res; 134 struct resource *res;
135 int ret; 135 int ret;
136 136
137 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
138 if (!res) {
139 dev_err(&pdev->dev, "Failed to get platform resource\n");
140 return -ENODEV;
141 }
142
143 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); 137 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
144 if (!priv) 138 if (!priv)
145 return -ENOMEM; 139 return -ENOMEM;
146 140
141 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
147 priv->sensor = devm_ioremap_resource(&pdev->dev, res); 142 priv->sensor = devm_ioremap_resource(&pdev->dev, res);
148 if (IS_ERR(priv->sensor)) 143 if (IS_ERR(priv->sensor))
149 return PTR_ERR(priv->sensor); 144 return PTR_ERR(priv->sensor);
150 145
151 res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 146 res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
152 if (!res) {
153 dev_err(&pdev->dev, "Failed to get platform resource\n");
154 return -ENODEV;
155 }
156 priv->control = devm_ioremap_resource(&pdev->dev, res); 147 priv->control = devm_ioremap_resource(&pdev->dev, res);
157 if (IS_ERR(priv->control)) 148 if (IS_ERR(priv->control))
158 return PTR_ERR(priv->control); 149 return PTR_ERR(priv->control);
@@ -182,7 +173,6 @@ static int dove_thermal_exit(struct platform_device *pdev)
182 platform_get_drvdata(pdev); 173 platform_get_drvdata(pdev);
183 174
184 thermal_zone_device_unregister(dove_thermal); 175 thermal_zone_device_unregister(dove_thermal);
185 platform_set_drvdata(pdev, NULL);
186 176
187 return 0; 177 return 0;
188} 178}