@@ -807,17 +807,21 @@ static int omap_dm_timer_probe(struct
platform_device *pdev)
struct resource *mem, *irq;
struct device *dev = &pdev->dev;
const struct of_device_id *match;
- const struct dmtimer_platform_data *pdata;
+ struct dmtimer_platform_data *pdata;
int ret;
match = of_match_device(of_match_ptr(omap_timer_match), dev);
- pdata = match ? match->data : dev->platform_data;
+ pdata = match ? (struct dmtimer_platform_data *)match->data :
+ dev->platform_data;
if (!pdata && !dev->of_node) {
dev_err(dev, "%s: no platform data.\n", __func__);
return -ENODEV;
}
+ if (!dev->platform_data)
+ dev->platform_data = pdata;
+
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (unlikely(!irq)) {