mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@samsung.com>
To: "'Axel Lin'" <axel.lin@ingics.com>
Cc: "'Andrew Morton'" <akpm@linux-foundation.org>,
	"'Alberto Panizzo'" <maramaopercheseimorto@gmail.com>,
	"'Richard Purdie'" <rpurdie@rpsys.net>,
	linux-kernel@vger.kernel.org,
	"'Jingoo Han'" <jg1.han@samsung.com>
Subject: Re: [PATCH] backlight: l4f00242t03: Convert to devm_regulator_get
Date: Mon, 07 Jan 2013 14:46:51 +0900	[thread overview]
Message-ID: <000601cdec9a$64663130$2d329390$%han@samsung.com> (raw)
In-Reply-To: <1357535807.14526.1.camel@phoenix>

On Monday, January 07, 2013 2:17 PM, Axel Lin wrote
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

It looks good.

Acked-by: Jingoo Han <jg1.han@samsung.com>


Best regards,
Jingoo Han

> ---
>  drivers/video/backlight/l4f00242t03.c |   24 +++++-------------------
>  1 file changed, 5 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c
> index 9bef9cf..fb61557 100644
> --- a/drivers/video/backlight/l4f00242t03.c
> +++ b/drivers/video/backlight/l4f00242t03.c
> @@ -190,27 +190,24 @@ static int l4f00242t03_probe(struct spi_device *spi)
>  		return ret;
>  	}
> 
> -	priv->io_reg = regulator_get(&spi->dev, "vdd");
> +	priv->io_reg = devm_regulator_get(&spi->dev, "vdd");
>  	if (IS_ERR(priv->io_reg)) {
>  		dev_err(&spi->dev, "%s: Unable to get the IO regulator\n",
>  		       __func__);
>  		return PTR_ERR(priv->io_reg);
>  	}
> 
> -	priv->core_reg = regulator_get(&spi->dev, "vcore");
> +	priv->core_reg = devm_regulator_get(&spi->dev, "vcore");
>  	if (IS_ERR(priv->core_reg)) {
> -		ret = PTR_ERR(priv->core_reg);
>  		dev_err(&spi->dev, "%s: Unable to get the core regulator\n",
>  		       __func__);
> -		goto err1;
> +		return PTR_ERR(priv->core_reg);
>  	}
> 
>  	priv->ld = lcd_device_register("l4f00242t03",
>  					&spi->dev, priv, &l4f_ops);
> -	if (IS_ERR(priv->ld)) {
> -		ret = PTR_ERR(priv->ld);
> -		goto err2;
> -	}
> +	if (IS_ERR(priv->ld))
> +		return PTR_ERR(priv->ld);
> 
>  	/* Init the LCD */
>  	l4f00242t03_lcd_init(spi);
> @@ -220,13 +217,6 @@ static int l4f00242t03_probe(struct spi_device *spi)
>  	dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n");
> 
>  	return 0;
> -
> -err2:
> -	regulator_put(priv->core_reg);
> -err1:
> -	regulator_put(priv->io_reg);
> -
> -	return ret;
>  }
> 
>  static int l4f00242t03_remove(struct spi_device *spi)
> @@ -235,12 +225,8 @@ static int l4f00242t03_remove(struct spi_device *spi)
> 
>  	l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);
>  	lcd_device_unregister(priv->ld);
> -
>  	spi_set_drvdata(spi, NULL);
> 
> -	regulator_put(priv->io_reg);
> -	regulator_put(priv->core_reg);
> -
>  	return 0;
>  }
> 
> --
> 1.7.9.5
> 



      reply	other threads:[~2013-01-07  5:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07  5:16 Axel Lin
2013-01-07  5:46 ` Jingoo Han [this message]

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='000601cdec9a$64663130$2d329390$%han@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=axel.lin@ingics.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maramaopercheseimorto@gmail.com \
    --cc=rpurdie@rpsys.net \
    /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

all inboxes | Powered by JetHome®