RE: [PM-SR][PATCH 06/12] omap3: sr: device: fail sr_dev_init should return error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




>>-----Original Message-----
>>From: Menon, Nishanth
>>Sent: Friday, August 06, 2010 3:54 AM
>>To: linux-omap
>>Cc: Menon, Nishanth; Kevin Hilman; Gopinath, Thara
>>Subject: [PM-SR][PATCH 06/12] omap3: sr: device: fail sr_dev_init should return error
>>
>>sr_dev_init should return error on error conditions
>>
>>Cc: Kevin Hilman <khilman@xxxxxxxxxxxxxxxxxxx>
>>Cc: Thara Gopinath <thara@xxxxxx>
>>
>>Signed-off-by: Nishanth Menon <nm@xxxxxx>
>>---
>> arch/arm/mach-omap2/sr_device.c |    3 ++-
>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>
>>diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
>>index 6f70da6..8fb60d8 100644
>>--- a/arch/arm/mach-omap2/sr_device.c
>>+++ b/arch/arm/mach-omap2/sr_device.c
>>@@ -162,7 +162,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),
>>@@ -172,6 +172,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);
>> 	}
NAK for this change.
This API is called from omap_hwmod_for_each_by_class for every smartreflex module.
If This API returns an error omap_hwmod_for_each_by_class will exit without looping over
rest of the smartreflex modules. This means a error for one smartreflex module will prevent
rest of the smartreflex modules to be initialized. We do not want this. Hence this API returns 0
for non-availability of data for a smartreflex module.

Regards
Thara

>> 	i++;
>> 	return 0;
>>--
>>1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux