From patchwork Tue Mar 18 10:23:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 26476 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f199.google.com (mail-ig0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 77B5F203C3 for ; Tue, 18 Mar 2014 10:29:40 +0000 (UTC) Received: by mail-ig0-f199.google.com with SMTP id uy17sf13519592igb.2 for ; Tue, 18 Mar 2014 03:29:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=KucIpsdaB3UFh/TZdkG32Mo9n46rzdgxynciKIDHrCo=; b=d8X2yqV52EfPODiq+cZ8McBNvXWFZqu7pVegBhx1/zh1ZDFJ8jzt+LXL2DYkHd4Lm6 qso8DiKbrB0flUwpLMSL80Fihe9Fpoc2guwCy2nDfSmdPgF7iDTC39f4KSSQh1huVXMz YQauuj4HjWnMeoB1j0U1kuuCZICloNssCWp+fbi/TDvnln1WEnuyRC4ult/GoSm5fGgO Egg4MeAFZo5ReE5ccfwunc+3rKKEBg/gYc6Q5oGklxLRFJciEaCdHOWO+G8dgo+8g2Lh U/Jpe9kW+tgZ2sbTRbK8lP/WxoppqzdkZlvfw+taIQBUsf+v4tqGwHYz8pJp88ocmZyC Yakg== X-Gm-Message-State: ALoCoQnvHSzuLS4++aC05FMqd/OBptGR2wOD64w4BaiZ6bL2VINlrpXlhqbQoo0J7Bcdqcm711ai X-Received: by 10.51.16.65 with SMTP id fu1mr7633832igd.3.1395138579986; Tue, 18 Mar 2014 03:29:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.184 with SMTP id w53ls2004564qge.45.gmail; Tue, 18 Mar 2014 03:29:39 -0700 (PDT) X-Received: by 10.52.175.166 with SMTP id cb6mr20294129vdc.1.1395138579839; Tue, 18 Mar 2014 03:29:39 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id sr19si6323226vcb.71.2014.03.18.03.29.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Mar 2014 03:29:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id il7so6928566vcb.18 for ; Tue, 18 Mar 2014 03:29:39 -0700 (PDT) X-Received: by 10.52.175.166 with SMTP id cb6mr20294128vdc.1.1395138579753; Tue, 18 Mar 2014 03:29:39 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp193914vck; Tue, 18 Mar 2014 03:29:39 -0700 (PDT) X-Received: by 10.66.175.4 with SMTP id bw4mr32236448pac.56.1395138578461; Tue, 18 Mar 2014 03:29:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zh8si12136985pac.441.2014.03.18.03.29.37; Tue, 18 Mar 2014 03:29:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754859AbaCRK3d (ORCPT + 26 others); Tue, 18 Mar 2014 06:29:33 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:64812 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753953AbaCRK33 (ORCPT ); Tue, 18 Mar 2014 06:29:29 -0400 Received: by mail-pd0-f175.google.com with SMTP id x10so6905092pdj.20 for ; Tue, 18 Mar 2014 03:29:29 -0700 (PDT) X-Received: by 10.66.121.131 with SMTP id lk3mr32012530pab.61.1395138569130; Tue, 18 Mar 2014 03:29:29 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id id10sm51276560pbc.35.2014.03.18.03.29.26 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Mar 2014 03:29:28 -0700 (PDT) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: broonie@kernel.org, lgirdwood@gmail.com, sachin.kamat@linaro.org Subject: [PATCH 2/4] regulator: max8660: Silence checkpatch warnings Date: Tue, 18 Mar 2014 15:53:02 +0530 Message-Id: <1395138184-25287-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1395138184-25287-1-git-send-email-sachin.kamat@linaro.org> References: <1395138184-25287-1-git-send-email-sachin.kamat@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Silences the following type of error/warnings: ERROR: that open brace { should be on the previous line WARNING: Missing a blank line after declarations Signed-off-by: Sachin Kamat --- drivers/regulator/max8660.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c index bbbe53b1b5bf..aabfb3b2407c 100644 --- a/drivers/regulator/max8660.c +++ b/drivers/regulator/max8660.c @@ -85,11 +85,12 @@ struct max8660 { static int max8660_write(struct max8660 *max8660, u8 reg, u8 mask, u8 val) { - static const u8 max8660_addresses[MAX8660_N_REGS] = - { 0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 }; + static const u8 max8660_addresses[MAX8660_N_REGS] = { + 0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 }; int ret; u8 reg_val = (max8660->shadow_regs[reg] & mask) | val; + dev_vdbg(&max8660->client->dev, "Writing reg %02x with %02x\n", max8660_addresses[reg], reg_val); @@ -111,6 +112,7 @@ static int max8660_dcdc_is_enabled(struct regulator_dev *rdev) struct max8660 *max8660 = rdev_get_drvdata(rdev); u8 val = max8660->shadow_regs[MAX8660_OVER1]; u8 mask = (rdev_get_id(rdev) == MAX8660_V3) ? 1 : 4; + return !!(val & mask); } @@ -118,6 +120,7 @@ static int max8660_dcdc_enable(struct regulator_dev *rdev) { struct max8660 *max8660 = rdev_get_drvdata(rdev); u8 bit = (rdev_get_id(rdev) == MAX8660_V3) ? 1 : 4; + return max8660_write(max8660, MAX8660_OVER1, 0xff, bit); } @@ -125,15 +128,16 @@ static int max8660_dcdc_disable(struct regulator_dev *rdev) { struct max8660 *max8660 = rdev_get_drvdata(rdev); u8 mask = (rdev_get_id(rdev) == MAX8660_V3) ? ~1 : ~4; + return max8660_write(max8660, MAX8660_OVER1, mask, 0); } static int max8660_dcdc_get_voltage_sel(struct regulator_dev *rdev) { struct max8660 *max8660 = rdev_get_drvdata(rdev); - u8 reg = (rdev_get_id(rdev) == MAX8660_V3) ? MAX8660_ADTV2 : MAX8660_SDTV2; u8 selector = max8660->shadow_regs[reg]; + return selector; } @@ -206,6 +210,7 @@ static int max8660_ldo67_is_enabled(struct regulator_dev *rdev) struct max8660 *max8660 = rdev_get_drvdata(rdev); u8 val = max8660->shadow_regs[MAX8660_OVER2]; u8 mask = (rdev_get_id(rdev) == MAX8660_V6) ? 2 : 4; + return !!(val & mask); } @@ -213,6 +218,7 @@ static int max8660_ldo67_enable(struct regulator_dev *rdev) { struct max8660 *max8660 = rdev_get_drvdata(rdev); u8 bit = (rdev_get_id(rdev) == MAX8660_V6) ? 2 : 4; + return max8660_write(max8660, MAX8660_OVER2, 0xff, bit); } @@ -220,15 +226,16 @@ static int max8660_ldo67_disable(struct regulator_dev *rdev) { struct max8660 *max8660 = rdev_get_drvdata(rdev); u8 mask = (rdev_get_id(rdev) == MAX8660_V6) ? ~2 : ~4; + return max8660_write(max8660, MAX8660_OVER2, mask, 0); } static int max8660_ldo67_get_voltage_sel(struct regulator_dev *rdev) { struct max8660 *max8660 = rdev_get_drvdata(rdev); - u8 shift = (rdev_get_id(rdev) == MAX8660_V6) ? 0 : 4; u8 selector = (max8660->shadow_regs[MAX8660_L12VCR] >> shift) & 0xf; + return selector; }