All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Keerthy <j-keerthy@ti.com>, Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] regulator: tps65218: Remove unnecessary regulator_unregister call
Date: Tue, 18 Feb 2014 20:22:29 +0800	[thread overview]
Message-ID: <1392726149.13262.2.camel@phoenix> (raw)
In-Reply-To: <1392726059.13262.0.camel@phoenix>

Current code uses devm_regulator_register() so the we don't need to explicitly
call regulator_unregister() in .remove.
And then we don't need to save rdev pointer to tps->rdev[id].

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/tps65218-regulator.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c
index 00c0114..cec72fa 100644
--- a/drivers/regulator/tps65218-regulator.c
+++ b/drivers/regulator/tps65218-regulator.c
@@ -265,23 +265,6 @@ static int tps65218_regulator_probe(struct platform_device *pdev)
 		return PTR_ERR(rdev);
 	}
 
-	/* Save regulator */
-	tps->rdev[id] = rdev;
-
-	return 0;
-}
-
-static int tps65218_regulator_remove(struct platform_device *pdev)
-{
-	struct tps65218 *tps = platform_get_drvdata(pdev);
-	const struct of_device_id	*match;
-	const struct tps_info		*template;
-
-	match = of_match_device(tps65218_of_match, &pdev->dev);
-	template = match->data;
-	regulator_unregister(tps->rdev[template->id]);
-	platform_set_drvdata(pdev, NULL);
-
 	return 0;
 }
 
@@ -292,7 +275,6 @@ static struct platform_driver tps65218_regulator_driver = {
 		.of_match_table = tps65218_of_match,
 	},
 	.probe = tps65218_regulator_probe,
-	.remove = tps65218_regulator_remove,
 };
 
 module_platform_driver(tps65218_regulator_driver);
-- 
1.8.1.2




  reply	other threads:[~2014-02-18 12:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-18 12:20 [PATCH 1/2] regulator: tps65218: Add terminate entry for of_device_id table Axel Lin
2014-02-18 12:22 ` Axel Lin [this message]
2014-02-19  5:00 ` 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=1392726149.13262.2.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=j-keerthy@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.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.