From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754078AbdBDKse (ORCPT ); Sat, 4 Feb 2017 05:48:34 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:35260 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754035AbdBDKs3 (ORCPT ); Sat, 4 Feb 2017 05:48:29 -0500 From: Mark Brown To: Dmitry Torokhov Cc: Mark Brown , Mark Brown , Liam Girdwood , linux-kernel@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20170203215604.23285-1-dmitry.torokhov@gmail.com> Message-Id: Date: Sat, 04 Feb 2017 11:48:19 +0100 X-SA-Exim-Connect-IP: 2001:67c:1810:f051:e387:5dab:49ba:da3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Applied "regulator: core: remove dead code in _regulator_get()" to the regulator tree X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch regulator: core: remove dead code in _regulator_get() has been applied to the regulator tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >>From 7d245afa24b3ed911f6fd90079d70932ac5e5923 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Feb 2017 13:56:00 -0800 Subject: [PATCH] regulator: core: remove dead code in _regulator_get() There is no point in assigning value to 'ret' before calling regulator_dev_lookup() as it will clobber 'ret' anyway. Also, let's explicitly return -PROBE_DEFER when try_module_get() fails, instead of relying that earlier initialization of "regulator" carries correct value. Signed-off-by: Dmitry Torokhov Signed-off-by: Mark Brown --- drivers/regulator/core.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 04baac9a165b..b0ee068310c5 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1584,7 +1584,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, bool exclusive, bool allow_dummy) { struct regulator_dev *rdev; - struct regulator *regulator = ERR_PTR(-EPROBE_DEFER); + struct regulator *regulator; const char *devname = NULL; int ret; @@ -1596,11 +1596,6 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, if (dev) devname = dev_name(dev); - if (have_full_constraints()) - ret = -ENODEV; - else - ret = -EPROBE_DEFER; - rdev = regulator_dev_lookup(dev, id, &ret); if (rdev) goto found; @@ -1656,6 +1651,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, } if (!try_module_get(rdev->owner)) { + regulator = ERR_PTR(-EPROBE_DEFER); put_device(&rdev->dev); return regulator; } -- 2.11.0