Commit bc83cadd authored by Yangtao Li's avatar Yangtao Li Committed by Daniel Lezcano

clocksource/drivers/timer-ti-dm: Switch to platform_get_irq

platform_get_resource(pdev, IORESOURCE_IRQ) is not recommended for
requesting IRQ's resources, as they can be not ready yet. Using
platform_get_irq() instead is preferred for getting IRQ even if it
was not retrieved earlier.
Signed-off-by: default avatarYangtao Li <tiny.windzz@gmail.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20191221173027.30716-5-tiny.windzz@gmail.com
parent cdab83f9
...@@ -780,7 +780,6 @@ static int omap_dm_timer_probe(struct platform_device *pdev) ...@@ -780,7 +780,6 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
{ {
unsigned long flags; unsigned long flags;
struct omap_dm_timer *timer; struct omap_dm_timer *timer;
struct resource *irq;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
const struct dmtimer_platform_data *pdata; const struct dmtimer_platform_data *pdata;
int ret; int ret;
...@@ -796,11 +795,9 @@ static int omap_dm_timer_probe(struct platform_device *pdev) ...@@ -796,11 +795,9 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
} }
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); timer->irq = platform_get_irq(pdev, 0);
if (unlikely(!irq)) { if (timer->irq < 0)
dev_err(dev, "%s: no IRQ resource.\n", __func__); return timer->irq;
return -ENODEV;
}
timer = devm_kzalloc(dev, sizeof(*timer), GFP_KERNEL); timer = devm_kzalloc(dev, sizeof(*timer), GFP_KERNEL);
if (!timer) if (!timer)
...@@ -830,7 +827,6 @@ static int omap_dm_timer_probe(struct platform_device *pdev) ...@@ -830,7 +827,6 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
if (pdata) if (pdata)
timer->errata = pdata->timer_errata; timer->errata = pdata->timer_errata;
timer->irq = irq->start;
timer->pdev = pdev; timer->pdev = pdev;
pm_runtime_enable(dev); pm_runtime_enable(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment