From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755196AbaBRMW6 (ORCPT ); Tue, 18 Feb 2014 07:22:58 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:42120 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754266AbaBRMW5 (ORCPT ); Tue, 18 Feb 2014 07:22:57 -0500 Message-ID: <1392726149.13262.2.camel@phoenix> Subject: [PATCH 2/2] regulator: tps65218: Remove unnecessary regulator_unregister call From: Axel Lin To: Mark Brown Cc: Keerthy , Liam Girdwood , linux-kernel@vger.kernel.org Date: Tue, 18 Feb 2014 20:22:29 +0800 In-Reply-To: <1392726059.13262.0.camel@phoenix> References: <1392726059.13262.0.camel@phoenix> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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