* [PATCH] regulator: twl: Convert to use devm_kmemdup()
@ 2014-06-16 1:44 Axel Lin
2014-06-16 12:59 ` Nishanth Menon
2014-06-27 11:50 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2014-06-16 1:44 UTC (permalink / raw)
To: Mark Brown
Cc: Nishanth Menon, Aaro Koskinen, Rajendra Nayak, Liam Girdwood,
linux-kernel
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".
*/
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] regulator: twl: Convert to use devm_kmemdup()
2014-06-16 1:44 [PATCH] regulator: twl: Convert to use devm_kmemdup() Axel Lin
@ 2014-06-16 12:59 ` Nishanth Menon
2014-06-27 11:50 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Nishanth Menon @ 2014-06-16 12:59 UTC (permalink / raw)
To: Axel Lin, Mark Brown
Cc: Aaro Koskinen, Rajendra Nayak, Liam Girdwood, linux-kernel, linux-omap
+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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] regulator: twl: Convert to use devm_kmemdup()
2014-06-16 1:44 [PATCH] regulator: twl: Convert to use devm_kmemdup() Axel Lin
2014-06-16 12:59 ` Nishanth Menon
@ 2014-06-27 11:50 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-06-27 11:50 UTC (permalink / raw)
To: Axel Lin
Cc: Nishanth Menon, Aaro Koskinen, Rajendra Nayak, Liam Girdwood,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 124 bytes --]
On Mon, Jun 16, 2014 at 09:44:20AM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-27 11:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-16 1:44 [PATCH] regulator: twl: Convert to use devm_kmemdup() Axel Lin
2014-06-16 12:59 ` Nishanth Menon
2014-06-27 11:50 ` Mark Brown
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).