Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753329AbcBZCro (ORCPT ); Thu, 25 Feb 2016 21:47:44 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:37660 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752435AbcBZCrn (ORCPT ); Thu, 25 Feb 2016 21:47:43 -0500 From: Mark Brown To: Axel Lin , Mark Brown Cc: linux-kernel@vger.kernel.org In-Reply-To: Message-Id: Date: Fri, 26 Feb 2016 11:47:39 +0900 X-SA-Exim-Connect-IP: 122.212.32.58 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Applied "regulator: max77620: Eliminate duplicate code" to the regulator tree X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch regulator: max77620: Eliminate duplicate code 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 aad76f743b040fe1b113691e92a2983b39c1f114 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 25 Feb 2016 14:40:09 +0800 Subject: [PATCH] regulator: max77620: Eliminate duplicate code Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- drivers/regulator/max77620-regulator.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/regulator/max77620-regulator.c b/drivers/regulator/max77620-regulator.c index 761eb965f901..0eb5d18999e6 100644 --- a/drivers/regulator/max77620-regulator.c +++ b/drivers/regulator/max77620-regulator.c @@ -264,15 +264,15 @@ static int max77620_read_slew_rate(struct max77620_regulator *pmic, int id) int slew_rate; int ret; + ret = regmap_read(pmic->rmap, rinfo->cfg_addr, &rval); + if (ret < 0) { + dev_err(pmic->dev, "Register 0x%02x read failed: %d\n", + rinfo->cfg_addr, ret); + return ret; + } + switch (rinfo->type) { case MAX77620_REGULATOR_TYPE_SD: - ret = regmap_read(pmic->rmap, rinfo->cfg_addr, &rval); - if (ret < 0) { - dev_err(pmic->dev, "Register 0x%02x read failed: %d\n", - rinfo->cfg_addr, ret); - return ret; - } - slew_rate = (rval >> MAX77620_SD_SR_SHIFT) & 0x3; switch (slew_rate) { case 0: @@ -291,12 +291,6 @@ static int max77620_read_slew_rate(struct max77620_regulator *pmic, int id) rinfo->desc.ramp_delay = slew_rate; break; default: - ret = regmap_read(pmic->rmap, rinfo->cfg_addr, &rval); - if (ret < 0) { - dev_err(pmic->dev, "Register 0x%02x read failed: %d\n", - rinfo->cfg_addr, ret); - return ret; - } slew_rate = rval & 0x1; switch (slew_rate) { case 0: -- 2.7.0