All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: Axel Lin <axel.lin@ingics.com>, Mark Brown <broonie@kernel.org>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>,
	Rajendra Nayak <rnayak@ti.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org,
	linux-omap <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] regulator: twl: Convert to use devm_kmemdup()
Date: Mon, 16 Jun 2014 07:59:22 -0500	[thread overview]
Message-ID: <539EEA2A.2040207@ti.com> (raw)
In-Reply-To: <1402883060.4707.1.camel@phoenix>

+linux-omap.

On 06/15/2014 08:44 PM, Axel Lin wrote:

Might be nice to have a commit message here.

> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/regulator/twl-regulator.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
> index fed28ab..0b4f866 100644
> --- a/drivers/regulator/twl-regulator.c
> +++ b/drivers/regulator/twl-regulator.c
> @@ -1128,7 +1128,7 @@ static int twlreg_probe(struct platform_device *pdev)
>  	if (!initdata)
>  		return -EINVAL;
>  
> -	info = kmemdup(template, sizeof(*info), GFP_KERNEL);
> +	info = devm_kmemdup(&pdev->dev, template, sizeof(*info), GFP_KERNEL);
>  	if (!info)
>  		return -ENOMEM;
>  
> @@ -1192,7 +1192,6 @@ static int twlreg_probe(struct platform_device *pdev)
>  	if (IS_ERR(rdev)) {
>  		dev_err(&pdev->dev, "can't register %s, %ld\n",
>  				info->desc.name, PTR_ERR(rdev));
> -		kfree(info);
>  		return PTR_ERR(rdev);
>  	}
>  	platform_set_drvdata(pdev, rdev);
> @@ -1212,20 +1211,10 @@ static int twlreg_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int twlreg_remove(struct platform_device *pdev)
> -{
> -	struct regulator_dev *rdev = platform_get_drvdata(pdev);
> -	struct twlreg_info *info = rdev->reg_data;
> -
> -	kfree(info);
> -	return 0;
> -}
> -
>  MODULE_ALIAS("platform:twl_reg");
>  
>  static struct platform_driver twlreg_driver = {
>  	.probe		= twlreg_probe,
> -	.remove		= twlreg_remove,
>  	/* NOTE: short name, to work around driver model truncation of
>  	 * "twl_regulator.12" (and friends) to "twl_regulator.1".
>  	 */
> 

otherwise, looks good to me.
Reviewed-by: Nishanth Menon <nm@ti.com>

-- 
Regards,
Nishanth Menon

WARNING: multiple messages have this Message-ID (diff)
From: Nishanth Menon <nm@ti.com>
To: Axel Lin <axel.lin@ingics.com>, Mark Brown <broonie@kernel.org>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>,
	Rajendra Nayak <rnayak@ti.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	<linux-kernel@vger.kernel.org>,
	linux-omap <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] regulator: twl: Convert to use devm_kmemdup()
Date: Mon, 16 Jun 2014 07:59:22 -0500	[thread overview]
Message-ID: <539EEA2A.2040207@ti.com> (raw)
In-Reply-To: <1402883060.4707.1.camel@phoenix>

+linux-omap.

On 06/15/2014 08:44 PM, Axel Lin wrote:

Might be nice to have a commit message here.

> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/regulator/twl-regulator.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
> index fed28ab..0b4f866 100644
> --- a/drivers/regulator/twl-regulator.c
> +++ b/drivers/regulator/twl-regulator.c
> @@ -1128,7 +1128,7 @@ static int twlreg_probe(struct platform_device *pdev)
>  	if (!initdata)
>  		return -EINVAL;
>  
> -	info = kmemdup(template, sizeof(*info), GFP_KERNEL);
> +	info = devm_kmemdup(&pdev->dev, template, sizeof(*info), GFP_KERNEL);
>  	if (!info)
>  		return -ENOMEM;
>  
> @@ -1192,7 +1192,6 @@ static int twlreg_probe(struct platform_device *pdev)
>  	if (IS_ERR(rdev)) {
>  		dev_err(&pdev->dev, "can't register %s, %ld\n",
>  				info->desc.name, PTR_ERR(rdev));
> -		kfree(info);
>  		return PTR_ERR(rdev);
>  	}
>  	platform_set_drvdata(pdev, rdev);
> @@ -1212,20 +1211,10 @@ static int twlreg_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int twlreg_remove(struct platform_device *pdev)
> -{
> -	struct regulator_dev *rdev = platform_get_drvdata(pdev);
> -	struct twlreg_info *info = rdev->reg_data;
> -
> -	kfree(info);
> -	return 0;
> -}
> -
>  MODULE_ALIAS("platform:twl_reg");
>  
>  static struct platform_driver twlreg_driver = {
>  	.probe		= twlreg_probe,
> -	.remove		= twlreg_remove,
>  	/* NOTE: short name, to work around driver model truncation of
>  	 * "twl_regulator.12" (and friends) to "twl_regulator.1".
>  	 */
> 

otherwise, looks good to me.
Reviewed-by: Nishanth Menon <nm@ti.com>

-- 
Regards,
Nishanth Menon

  reply	other threads:[~2014-06-16 12:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16  1:44 [PATCH] regulator: twl: Convert to use devm_kmemdup() Axel Lin
2014-06-16 12:59 ` Nishanth Menon [this message]
2014-06-16 12:59   ` Nishanth Menon
2014-06-27 11:50 ` Mark Brown

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=539EEA2A.2040207@ti.com \
    --to=nm@ti.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rnayak@ti.com \
    /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.