linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] backlight: Fix broken regulator API usage in l4f00242t03
Date: Mon, 15 Aug 2011 06:42:42 +0000	[thread overview]
Message-ID: <20110815064242.GR31404@pengutronix.de> (raw)
In-Reply-To: <1313372500-28017-1-git-send-email-broonie@opensource.wolfsonmicro.com>

On Mon, Aug 15, 2011 at 10:41:40AM +0900, Mark Brown wrote:
> The regulator support in the l4f00242t03 is very non-idiomatic, rather
> than requesting the regulators based on the device name and the supply
> names used by the device the driver requires boards to pass system
> specific supply names around through platform data. The driver also
> conditionally requests the regulators based on this platform data, adding
> unneeded conditional code to the driver.
> 
> Fix this by removing the platform data and converting to the standard idiom,
> also updating all in tree users of the driver. As no datasheet appears to
> be available for the LCD I'm guessing the names for the supplies based on
> the existing users and I've no ability to do anything more than compile
> test.
> 
> The use of regulator_set_voltage() in the driver is also problematic, since
> fixed voltages are required the expectation would be that the voltages
> would be fixed in the constraints set by the machines rather than manually
> configured by the driver, but is less problematic.
> 
>  static int l4f00242t03_lcd_power_get(struct lcd_device *ld)
> @@ -202,24 +195,18 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi)
>  	if (ret)
>  		goto err3;
>  
> -	if (pdata->io_supply) {
> -		priv->io_reg = regulator_get(NULL, pdata->io_supply);
> -
> -		if (IS_ERR(priv->io_reg)) {
> -			pr_err("%s: Unable to get the IO regulator\n",
> -								__func__);
> -			goto err3;
> -		}
> +	priv->io_reg = regulator_get(&spi->dev, "vdd");
> +	if (IS_ERR(priv->io_reg)) {
> +		pr_err("%s: Unable to get the IO regulator\n",
> +		       __func__);
> +		goto err3;
>  	}
>  
> -	if (pdata->core_supply) {
> -		priv->core_reg = regulator_get(NULL, pdata->core_supply);
> -
> -		if (IS_ERR(priv->core_reg)) {
> -			pr_err("%s: Unable to get the core regulator\n",
> -								__func__);
> -			goto err4;
> -		}
> +	priv->core_reg = regulator_get(&spi->dev, "vcore");
> +	if (IS_ERR(priv->core_reg)) {
> +		pr_err("%s: Unable to get the core regulator\n",
> +		       __func__);
> +		goto err4;
>  	}

Maybe you could change these pr_err to dev_err on the way. The rest of
the driver already uses dev_*.

Sascha


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

  reply	other threads:[~2011-08-15  6:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-15  1:41 [PATCH] backlight: Fix broken regulator API usage in l4f00242t03 Mark Brown
2011-08-15  6:42 ` Sascha Hauer [this message]
2011-08-15 13:06   ` Mark Brown
2011-08-15 15:48     ` Sascha Hauer
2011-08-15 14:50 ` Mark Brown
2011-08-19  3:50   ` Fabio Estevam

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=20110815064242.GR31404@pengutronix.de \
    --to=s.hauer@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).