@@ -129,7 +129,7 @@ static int __init omap_devinit_smartreflex(void)
char *name = "smartreflex";
do {
- struct omap_smartreflex_data *sr_data;
+ struct omap_smartreflex_data sr_data;
struct omap_smartreflex_dev_data *sr_dev_data;
struct omap_device *od;
struct omap_hwmod *oh;
@@ -140,15 +140,7 @@ static int __init omap_devinit_smartreflex(void)
if (!oh)
break;
- sr_data = kzalloc(sizeof(struct omap_smartreflex_data),
- GFP_KERNEL);
sr_dev_data = (struct omap_smartreflex_dev_data *)oh->dev_attr;
- if (!sr_data) {
- pr_warning("%s: could not find hwmod data for %d\n",
- __func__, i + 1);
- kfree(sr_data);
- return -ENOMEM;
- }
/*
* OMAP3430 ES3.1 chips by default come with Efuse burnt
@@ -159,26 +151,25 @@ static int __init omap_devinit_smartreflex(void)
*/
if (cpu_is_omap343x()) {
if (omap_rev() == OMAP3430_REV_ES3_1)
- sr_data->enable_on_init = true;
+ sr_data.enable_on_init = true;
else
- sr_data->enable_on_init = false;
+ sr_data.enable_on_init = false;
} else {
- sr_data->enable_on_init = false;
+ sr_data.enable_on_init = false;
}
- sr_data->device_enable = omap_device_enable;
- sr_data->device_shutdown = omap_device_shutdown;
- sr_data->device_idle = omap_device_idle;
+ sr_data.device_enable = omap_device_enable;
+ sr_data.device_shutdown = omap_device_shutdown;
+ sr_data.device_idle = omap_device_idle;
omap_get_voltage_table(i, &sr_dev_data->volt_data,
&sr_dev_data->volts_supported);
- sr_set_nvalues(sr_dev_data, sr_data);
+ sr_set_nvalues(sr_dev_data, &sr_data);
- od = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data),
+ od = omap_device_build(name, i, oh, &sr_data, sizeof(sr_data),
omap_sr_latency,
ARRAY_SIZE(omap_sr_latency), 0);
if (IS_ERR(od)) {
pr_warning("%s: Could not build omap_device %s:%s\n",
__func__, name, oh->name);
- kfree(sr_data);
}
i++;
} while (1);