aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-tegra.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-tegra.c')
-rw-r--r--drivers/rtc/rtc-tegra.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
index c006025cecc8..7c033756d6b5 100644
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -303,7 +303,13 @@ static struct rtc_class_ops tegra_rtc_ops = {
303 .alarm_irq_enable = tegra_rtc_alarm_irq_enable, 303 .alarm_irq_enable = tegra_rtc_alarm_irq_enable,
304}; 304};
305 305
306static int __devinit tegra_rtc_probe(struct platform_device *pdev) 306static const struct of_device_id tegra_rtc_dt_match[] = {
307 { .compatible = "nvidia,tegra20-rtc", },
308 {}
309};
310MODULE_DEVICE_TABLE(of, tegra_rtc_dt_match);
311
312static int tegra_rtc_probe(struct platform_device *pdev)
307{ 313{
308 struct tegra_rtc_info *info; 314 struct tegra_rtc_info *info;
309 struct resource *res; 315 struct resource *res;
@@ -321,11 +327,9 @@ static int __devinit tegra_rtc_probe(struct platform_device *pdev)
321 return -EBUSY; 327 return -EBUSY;
322 } 328 }
323 329
324 info->rtc_base = devm_request_and_ioremap(&pdev->dev, res); 330 info->rtc_base = devm_ioremap_resource(&pdev->dev, res);
325 if (!info->rtc_base) { 331 if (IS_ERR(info->rtc_base))
326 dev_err(&pdev->dev, "Unable to request mem region and grab IOs for device.\n"); 332 return PTR_ERR(info->rtc_base);
327 return -EBUSY;
328 }
329 333
330 info->tegra_rtc_irq = platform_get_irq(pdev, 0); 334 info->tegra_rtc_irq = platform_get_irq(pdev, 0);
331 if (info->tegra_rtc_irq <= 0) 335 if (info->tegra_rtc_irq <= 0)
@@ -375,7 +379,7 @@ err_dev_unreg:
375 return ret; 379 return ret;
376} 380}
377 381
378static int __devexit tegra_rtc_remove(struct platform_device *pdev) 382static int tegra_rtc_remove(struct platform_device *pdev)
379{ 383{
380 struct tegra_rtc_info *info = platform_get_drvdata(pdev); 384 struct tegra_rtc_info *info = platform_get_drvdata(pdev);
381 385
@@ -435,11 +439,12 @@ static void tegra_rtc_shutdown(struct platform_device *pdev)
435 439
436MODULE_ALIAS("platform:tegra_rtc"); 440MODULE_ALIAS("platform:tegra_rtc");
437static struct platform_driver tegra_rtc_driver = { 441static struct platform_driver tegra_rtc_driver = {
438 .remove = __devexit_p(tegra_rtc_remove), 442 .remove = tegra_rtc_remove,
439 .shutdown = tegra_rtc_shutdown, 443 .shutdown = tegra_rtc_shutdown,
440 .driver = { 444 .driver = {
441 .name = "tegra_rtc", 445 .name = "tegra_rtc",
442 .owner = THIS_MODULE, 446 .owner = THIS_MODULE,
447 .of_match_table = tegra_rtc_dt_match,
443 }, 448 },
444#ifdef CONFIG_PM 449#ifdef CONFIG_PM
445 .suspend = tegra_rtc_suspend, 450 .suspend = tegra_rtc_suspend,