lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 22 Mar 2012 18:17:59 -0700
From:	Michael Bohan <mbohan@...eaurora.org>
To:	rnayak@...com, broonie@...nsource.wolfsonmicro.com, lrg@...com
CC:	LKML <linux-kernel@...r.kernel.org>, linux-arm-msm@...r.kernel.org
Subject: Regulator supplies when using Device Tree

Hi,

I'm curious if there was a reason we didn't standardize on a binding 
name for regulator supplies when using Device Tree. This appears to 
cause duplicated code for regulator drivers that support devices that 
may or may not have supplies specified.

For example, if one were to set rdesc->supply_name to a chosen supply 
name "parent" and that particular device does not exist in the Device 
Tree topology, then regulator_register() will fail. So in the driver, we 
have to first use of_get_property() to verify that "parent-supply" is 
defined. Only then do we set rdesc->supply_name. Since I have multiple 
regulator drivers that may or may not have supplies, each has to 
duplicate this check.

But it seems like if we agreed on a standardized supply name for 
regulators, then we could move that complexity to 
of_get_regulator_init_data(). Having multiple supply names sure makes 
sense for consumers, but for supplies, there can ever only be one.

I guess another alternative is to have the driver unconditionally assign 
rdesc->supply_name, but change the framework to not fail the 
regulator_register() if the supply is not specified in the topology. If 
it is specified but fails either a phandle lookup or the targeted supply 
regulator is not valid, then fail only in those cases.

Also, I'm curious why we need two pointers for the supply name. There's 
currently regulator_desc->supply_name, recently added for Device Tree, 
and then the old init_data->supply_regulator. Is there a need for both?

Thanks,
Mike

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ