Re: [PATCH 8/9] regulator: helper to extract regulator node based on supply name

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

 



On Tuesday 27 September 2011 05:51 PM, Mark Brown wrote:
On Tue, Sep 27, 2011 at 03:42:51PM +0530, Rajendra Nayak wrote:

+	if (!dev)
+		return NULL;

So how do we handle CPUs?  cpufreq is one of the most active users of
regulators...

Hmm, never thought of it :(
Maybe I should associate a supply name with all
regulators and then lookup from the global registered
list.


+	snprintf(prop_name, 32, "%s-supply", supply);
+
+	prop = of_get_property(dev->of_node, prop_name,&sz);
+	if (!prop || sz<  4)
+		return NULL;

sz<  4?  Magic!  :)

Its the valid phandle size.
I guess I need a sz != 4


+extern struct device_node *of_get_regulator(struct device *dev,
+	const char *supply);

This shouldn't be part of the public API, it should be transparently
handled within the core.

agreed.

--
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