diff mbox

[PM-SR,7/7] omap3: sr: device: fail sr_dev_init should return error

Message ID 1277502400-9915-8-git-send-email-nm@ti.com (mailing list archive)
State New, archived
Delegated to: Kevin Hilman
Headers show

Commit Message

Nishanth Menon June 25, 2010, 9:46 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index 81d2532..945ff45 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -163,7 +163,7 @@  static int sr_dev_init(struct omap_hwmod *oh, void *user)
 				__func__, i + 1);
 		i++;
 		kfree(sr_data);
-		return 0;
+		return -ENODATA;
 	}
 	sr_set_nvalues(sr_dev_data, sr_data);
 	od = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data),
@@ -173,6 +173,7 @@  static int sr_dev_init(struct omap_hwmod *oh, void *user)
 		pr_warning("%s: Could not build omap_device for %s: %s.\n\n",
 			__func__, name, oh->name);
 		kfree(sr_data);
+		return PTR_ERR(od);
 	}
 	i++;
 	return 0;