All of lore.kernel.org
 help / color / mirror / Atom feed
From: mpa@pengutronix.de (Markus Pargmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] regulator: Remove unnecessary ena_gpio initializations
Date: Tue, 7 Oct 2014 11:14:41 +0200	[thread overview]
Message-ID: <20141007091441.GE5042@pengutronix.de> (raw)
In-Reply-To: <5433A9CD.8090007@samsung.com>

On Tue, Oct 07, 2014 at 10:52:29AM +0200, Krzysztof Koz?owski wrote:
> On 06.10.2014 22:17, Markus Pargmann wrote:
> >It is not necessary to setup config.ena_gpio with -EINVAL or similar.
> >This patch removes these unnecessary initializations.
> >
> >Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> >---
> >  drivers/regulator/pfuze100-regulator.c | 1 -
> >  drivers/regulator/s5m8767.c            | 2 --
> >  2 files changed, 3 deletions(-)
> >
> >diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c
> >index c879dff597ee..d7455ee309bf 100644
> >--- a/drivers/regulator/pfuze100-regulator.c
> >+++ b/drivers/regulator/pfuze100-regulator.c
> >@@ -509,7 +509,6 @@ static int pfuze100_regulator_probe(struct i2c_client *client,
> >  		config.init_data = init_data;
> >  		config.driver_data = pfuze_chip;
> >  		config.of_node = match_of_node(i);
> >-		config.ena_gpio = -EINVAL;
> >
> >  		pfuze_chip->regulators[i] =
> >  			devm_regulator_register(&client->dev, desc, &config);
> >diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
> >index d258e6613831..2c7817f12516 100644
> >--- a/drivers/regulator/s5m8767.c
> >+++ b/drivers/regulator/s5m8767.c
> >@@ -949,8 +949,6 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
> >  		config.driver_data = s5m8767;
> >  		config.regmap = iodev->regmap_pmic;
> >  		config.of_node = pdata->regulators[i].reg_node;
> >-		config.ena_gpio = -EINVAL;
> >-		config.ena_gpio_flags = 0;
> >  		if (gpio_is_valid(pdata->regulators[i].ext_control_gpio))
> >  			s5m8767_regulator_config_ext_control(s5m8767,
> >  					&pdata->regulators[i], &config);
> 
> This would bring back problem with carried over ena_gpio (commit
> f4fbb3ce342bc1 "regulator: s5m8767: Fix carried over ena_gpio
> assignment").
> 
> The "config" is re-used in loop for next regulators. This means that
> the "config.ena_gpio" has to be set here to prevent using the same
> value for next regulator.
> 
> I think these lines shouldn't be removed.

Yes right, thanks.

Best regards,

Markus

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
-------------- 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/20141007/1824284c/attachment-0001.sig>

WARNING: multiple messages have this Message-ID (diff)
From: Markus Pargmann <mpa@pengutronix.de>
To: "Krzysztof Kozłowski" <k.kozlowski@samsung.com>
Cc: Mark Brown <broonie@kernel.org>,
	kernel@pengutronix.de, Liam Girdwood <lgirdwood@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] regulator: Remove unnecessary ena_gpio initializations
Date: Tue, 7 Oct 2014 11:14:41 +0200	[thread overview]
Message-ID: <20141007091441.GE5042@pengutronix.de> (raw)
In-Reply-To: <5433A9CD.8090007@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 2439 bytes --]

On Tue, Oct 07, 2014 at 10:52:29AM +0200, Krzysztof Kozłowski wrote:
> On 06.10.2014 22:17, Markus Pargmann wrote:
> >It is not necessary to setup config.ena_gpio with -EINVAL or similar.
> >This patch removes these unnecessary initializations.
> >
> >Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> >---
> >  drivers/regulator/pfuze100-regulator.c | 1 -
> >  drivers/regulator/s5m8767.c            | 2 --
> >  2 files changed, 3 deletions(-)
> >
> >diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c
> >index c879dff597ee..d7455ee309bf 100644
> >--- a/drivers/regulator/pfuze100-regulator.c
> >+++ b/drivers/regulator/pfuze100-regulator.c
> >@@ -509,7 +509,6 @@ static int pfuze100_regulator_probe(struct i2c_client *client,
> >  		config.init_data = init_data;
> >  		config.driver_data = pfuze_chip;
> >  		config.of_node = match_of_node(i);
> >-		config.ena_gpio = -EINVAL;
> >
> >  		pfuze_chip->regulators[i] =
> >  			devm_regulator_register(&client->dev, desc, &config);
> >diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
> >index d258e6613831..2c7817f12516 100644
> >--- a/drivers/regulator/s5m8767.c
> >+++ b/drivers/regulator/s5m8767.c
> >@@ -949,8 +949,6 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
> >  		config.driver_data = s5m8767;
> >  		config.regmap = iodev->regmap_pmic;
> >  		config.of_node = pdata->regulators[i].reg_node;
> >-		config.ena_gpio = -EINVAL;
> >-		config.ena_gpio_flags = 0;
> >  		if (gpio_is_valid(pdata->regulators[i].ext_control_gpio))
> >  			s5m8767_regulator_config_ext_control(s5m8767,
> >  					&pdata->regulators[i], &config);
> 
> This would bring back problem with carried over ena_gpio (commit
> f4fbb3ce342bc1 "regulator: s5m8767: Fix carried over ena_gpio
> assignment").
> 
> The "config" is re-used in loop for next regulators. This means that
> the "config.ena_gpio" has to be set here to prevent using the same
> value for next regulator.
> 
> I think these lines shouldn't be removed.

Yes right, thanks.

Best regards,

Markus

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-10-07  9:14 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 20:17 [PATCH 0/5] regulator: Fix core behaviour for gpio 0 Markus Pargmann
2014-10-06 20:17 ` Markus Pargmann
2014-10-06 20:17 ` [PATCH 1/5] regulator: Add ena_gpio_valid config Markus Pargmann
2014-10-06 20:17   ` Markus Pargmann
2014-10-07 11:53   ` Mark Brown
2014-10-07 11:53     ` Mark Brown
2014-10-07 13:03     ` Markus Pargmann
2014-10-07 13:03       ` Markus Pargmann
2014-10-07 16:19       ` Mark Brown
2014-10-07 16:19         ` Mark Brown
2014-10-07 19:18         ` Markus Pargmann
2014-10-07 19:18           ` Markus Pargmann
2014-10-06 20:17 ` [PATCH 2/5] regulator: Set ena_gpio_valid in regulator drivers Markus Pargmann
2014-10-06 20:17   ` Markus Pargmann
2014-10-07  8:46   ` Krzysztof Kozłowski
2014-10-07  8:46     ` Krzysztof Kozłowski
2014-10-07  9:10     ` Markus Pargmann
2014-10-07  9:10       ` Markus Pargmann
2014-10-07 11:58   ` Mark Brown
2014-10-07 11:58     ` Mark Brown
2014-10-07 13:05     ` Markus Pargmann
2014-10-07 13:05       ` Markus Pargmann
2014-10-06 20:17 ` [PATCH 3/5] regulator: Fix ena_gpio check Markus Pargmann
2014-10-06 20:17   ` Markus Pargmann
2014-10-06 20:17 ` [PATCH 4/5] regulator: Use gpio_is_valid Markus Pargmann
2014-10-06 20:17   ` Markus Pargmann
2014-10-07 12:01   ` Mark Brown
2014-10-07 12:01     ` Mark Brown
2014-10-07 13:07     ` Markus Pargmann
2014-10-07 13:07       ` Markus Pargmann
2014-10-07 16:20       ` Mark Brown
2014-10-07 16:20         ` Mark Brown
2014-10-06 20:17 ` [PATCH 5/5] regulator: Remove unnecessary ena_gpio initializations Markus Pargmann
2014-10-06 20:17   ` Markus Pargmann
2014-10-07  8:52   ` Krzysztof Kozłowski
2014-10-07  8:52     ` Krzysztof Kozłowski
2014-10-07  9:14     ` Markus Pargmann [this message]
2014-10-07  9:14       ` Markus Pargmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141007091441.GE5042@pengutronix.de \
    --to=mpa@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.