aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2015-08-11 05:12:46 -0400
committerSebastian Reichel <sre@kernel.org>2015-09-22 09:18:52 -0400
commiteacd8d09db7f4504eea6b5fdc55a8fe5eaf62bed (patch)
tree97192cf5efd7ded144190636dc1eb905a3a32933
parent2a9123f185ca07dcd76f36242ee03bed3fe2ab5c (diff)
power/reset: at91-reset: remove useless at91_reset_platform_probe()
Since all the at91 platforms are now DT only, at91_reset_platform_probe() is now useless, remove it. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
-rw-r--r--drivers/power/reset/at91-reset.c47
1 files changed, 3 insertions, 44 deletions
diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c
index c378d4ec826f..16e12bd507a1 100644
--- a/drivers/power/reset/at91-reset.c
+++ b/drivers/power/reset/at91-reset.c
@@ -178,11 +178,11 @@ static struct notifier_block at91_restart_nb = {
178 .priority = 192, 178 .priority = 192,
179}; 179};
180 180
181static int at91_reset_of_probe(struct platform_device *pdev) 181static int at91_reset_probe(struct platform_device *pdev)
182{ 182{
183 const struct of_device_id *match; 183 const struct of_device_id *match;
184 struct device_node *np; 184 struct device_node *np;
185 int idx = 0; 185 int ret, idx = 0;
186 186
187 at91_rstc_base = of_iomap(pdev->dev.of_node, 0); 187 at91_rstc_base = of_iomap(pdev->dev.of_node, 0);
188 if (!at91_rstc_base) { 188 if (!at91_rstc_base) {
@@ -204,49 +204,8 @@ static int at91_reset_of_probe(struct platform_device *pdev)
204 204
205 match = of_match_node(at91_reset_of_match, pdev->dev.of_node); 205 match = of_match_node(at91_reset_of_match, pdev->dev.of_node);
206 at91_restart_nb.notifier_call = match->data; 206 at91_restart_nb.notifier_call = match->data;
207 return register_restart_handler(&at91_restart_nb);
208}
209
210static int at91_reset_platform_probe(struct platform_device *pdev)
211{
212 const struct platform_device_id *match;
213 struct resource *res;
214 int idx = 0;
215
216 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
217 at91_rstc_base = devm_ioremap_resource(&pdev->dev, res);
218 if (IS_ERR(at91_rstc_base)) {
219 dev_err(&pdev->dev, "Could not map reset controller address\n");
220 return PTR_ERR(at91_rstc_base);
221 }
222
223 for (idx = 0; idx < 2; idx++) {
224 res = platform_get_resource(pdev, IORESOURCE_MEM, idx + 1 );
225 at91_ramc_base[idx] = devm_ioremap(&pdev->dev, res->start,
226 resource_size(res));
227 if (!at91_ramc_base[idx]) {
228 dev_err(&pdev->dev, "Could not map ram controller address\n");
229 return -ENOMEM;
230 }
231 }
232
233 match = platform_get_device_id(pdev);
234 at91_restart_nb.notifier_call =
235 (int (*)(struct notifier_block *,
236 unsigned long, void *)) match->driver_data;
237
238 return register_restart_handler(&at91_restart_nb);
239}
240
241static int at91_reset_probe(struct platform_device *pdev)
242{
243 int ret;
244
245 if (pdev->dev.of_node)
246 ret = at91_reset_of_probe(pdev);
247 else
248 ret = at91_reset_platform_probe(pdev);
249 207
208 ret = register_restart_handler(&at91_restart_nb);
250 if (ret) 209 if (ret)
251 return ret; 210 return ret;
252 211