Thread (54 messages) 54 messages, 13 authors, 2014-02-17

[PATCH 1/3] mmc: add support for power-on sequencing through DT

From: broonie@kernel.org (Mark Brown)
Date: 2014-01-20 16:36:27
Also in: linux-devicetree, linux-mmc

On Sun, Jan 19, 2014 at 07:56:53PM -0800, Olof Johansson wrote:
+	if (host->card_regulator) {
NULL is a potentially valid regulator; use IS_ERR().  Also see below...
+		dev_dbg(host->parent, "Enabling external regulator");
+		if (regulator_enable(host->card_regulator))
+			dev_err(host->parent, "Failed to enable external regulator");
You should really log the error code here.
+	host->card_regulator = regulator_get(host->parent, "card-external-vcc");
+
...this won't handle probe deferral or other errors.  Given what this is
for it should probably be using regulator_get_optional(), the driver is
happy to carry on if a supply isn't available.  On the other hand it
just enables and disables so it's probably easier to just ignore that
and let the stub regulator get used anyway.

I have to say I do worry what happens if the device has multiple
supplies that need to be managed (which is common enough, for example
analogue and digital supplies tend to be decoupled) or if the device can
do useful things with the supplies.  In the case of SDIO it's *probably*
less relevant though I have seen applications where it might be.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140120/39e9521a/attachment.sig>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help