@@ -192,7 +192,7 @@ void __init omap2_dm_timer_setup_clksrc(void)
is_initialized = 1;
}
-void __init omap2_dm_timer_early_init(void)
+int __init omap2_dm_timer_early_init(void)
{
int i = 0;
@@ -219,7 +219,7 @@ void __init omap2_dm_timer_early_init(void)
break;
default:
/* Error should never enter here */
- return;
+ return -EINVAL;
}
pdata->io_base = ioremap(base, SZ_8K);
@@ -248,7 +248,12 @@ void __init omap2_dm_timer_early_init(void)
pdata = kzalloc(sizeof(struct omap_dm_timer_plat_info),
GFP_KERNEL);
-
+ if (!pdata) {
+ pr_err("%s:"
+ "No memory for omap_dm_timer_plat_info\n",
+ __func__);
+ return -ENOMEM;
+ }
pdata->omap_dm_clk_enable = omap2_dm_timer_enable;
pdata->omap_dm_clk_disable = omap2_dm_timer_disable;
pdata->omap_dm_set_source_clk = omap2_dm_timer_set_clk;
@@ -271,7 +276,7 @@ void __init omap2_dm_timer_early_init(void)
omap2_dm_timer_setup_clksrc();
early_platform_driver_register_all("earlytimer");
early_platform_driver_probe("earlytimer", NO_EARLY_TIMERS, 0);
- return;
+ return 0;
}
int __init omap2_dm_timer_init(void)
@@ -346,6 +351,12 @@ int __init omap2_dm_timer_init(void)
pdata = kzalloc(sizeof(struct omap_dm_timer_plat_info),
GFP_KERNEL);
+ if (!pdata) {
+ pr_err("%s:"
+ "No memory for omap_dm_timer_plat_info\n",
+ __func__);
+ return -ENOMEM;
+ }
pdata->omap_dm_clk_enable = omap2_dm_timer_enable;
pdata->omap_dm_clk_disable = omap2_dm_timer_disable;
pdata->omap_dm_set_source_clk = omap2_dm_timer_set_clk;
@@ -397,7 +408,12 @@ fail:
break;
pdata = kzalloc(sizeof(struct omap_dm_timer_plat_info),
GFP_KERNEL);
-
+ if (!pdata) {
+ pr_err("%s:"
+ "No memory for omap_dm_timer_plat_info\n",
+ __func__);
+ return -ENOMEM;
+ }
pdata->omap_dm_clk_enable = omap2_dm_timer_enable;
pdata->omap_dm_clk_disable = omap2_dm_timer_disable;
pdata->omap_dm_set_source_clk = omap2_dm_timer_set_clk;
@@ -52,6 +52,6 @@
#define OMAP44XX_GPTIMER11_BASE 0x48088000
#define OMAP44XX_GPTIMER12_BASE 0x4a320000
-void __init omap2_dm_timer_early_init(void);
+int __init omap2_dm_timer_early_init(void);
#endif