Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1592283 > unrolled thread

[bug] regulator: fixed, gpio: probe fails on unset regulator-name

Started byHarald Geyer <harald@ccbib.org>
First post2017-03-03 22:30 +0100
Last post2017-03-06 11:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [bug] regulator: fixed, gpio: probe fails on unset regulator-name Harald Geyer <harald@ccbib.org> - 2017-03-03 22:30 +0100
    Re: [bug] regulator: fixed, gpio: probe fails on unset regulator-name Mark Brown <broonie@kernel.org> - 2017-03-06 11:20 +0100

#1592283 — [bug] regulator: fixed, gpio: probe fails on unset regulator-name

FromHarald Geyer <harald@ccbib.org>
Date2017-03-03 22:30 +0100
Subject[bug] regulator: fixed, gpio: probe fails on unset regulator-name
Message-ID<th2VY-70F-13@gated-at.bofh.it>
Hi!

Documentation/devicetree/bindings/regulator/regulator.txt says that the
regulator-name property is optional. However fixed and gpio regulators
fail in probe with the following message, if the property is not 
present:

| reg-fixed-voltage regulators:sensor_supply: Failed to allocate supply 
name
| reg-fixed-voltage: probe of regulators:sensor_supply failed with 
error -12

This is caused by the following code in both drivers:
         drvdata->desc.name = devm_kstrdup(&pdev->dev,
                                           config->supply_name,
                                           GFP_KERNEL);
         if (drvdata->desc.name == NULL) {
                 dev_err(&pdev->dev, "Failed to allocate supply 
name\n");
                 return -ENOMEM;
         }

If config->supply_name == NULL, then devm_kstrdup() also returns NULL.

I don't know whether the binding document or the implementation is 
wrong,
so can't propose a fix for this. Sorry.

TIA,
Harald

-- 
If you want to support my work:
see http://friends.ccbib.org/harald/supporting/
or donate via peercoin to P98LRdhit3gZbHDBe7ta5jtXrMJUms4p7w
or CLAM xASPBtezLNqj4cUe8MT5nZjthRSEjrRQXN

[toc] | [next] | [standalone]


#1593152

FromMark Brown <broonie@kernel.org>
Date2017-03-06 11:20 +0100
Message-ID<thXUe-6JB-21@gated-at.bofh.it>
In reply to#1592283

[Multipart message — attachments visible in raw view] — view raw

On Fri, Mar 03, 2017 at 10:20:44PM +0100, Harald Geyer wrote:

> I don't know whether the binding document or the implementation is wrong,
> so can't propose a fix for this. Sorry.

The documentation for the fixed and GPIO regulators needs to be updated,
it the property is optional for general regulators but required for
them.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web