From patchwork Mon Dec 3 18:12:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajanikanth HV X-Patchwork-Id: 1834741 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 295EB3FCD5 for ; Mon, 3 Dec 2012 18:19:17 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TfaZ9-0006DH-Vm; Mon, 03 Dec 2012 18:16:28 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TfaZ7-0006Cw-3j for linux-arm-kernel@lists.infradead.org; Mon, 03 Dec 2012 18:16:25 +0000 Received: by mail-pb0-f49.google.com with SMTP id un15so1891288pbc.36 for ; Mon, 03 Dec 2012 10:16:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=/vfDcv9Jbn2PYC52QcWls+3ZVafSxyoeLH8LlNMfK90=; b=oF/yaPRIsoQBc6MEut5Ryl3vgcpj4HJLgxWJlun7dnM77OKhawudtgNbGxGnehQkR3 0NiKSaNR6hiW92SwkybSv6nF9982rmD3blxc/HjTp5l5zpgT9VJFLrtq5WLwqrC9XbZC t8Fvh9BgynOUsXk8L3KDIJoLKKYWiHhx0PNB1cf0IMDlrLsSXGga9w9M+8juDjEz17NO WPnX6cxB2/+ApV1eyEDbNuYCB0biKmgW46f11enbkPbpvE9SlJ0fLRG+oqUahO9kG7cD PbjtcZCD/Hjz4X+7xLxqRQb7JtN+2HVsAAaiSrkoEoAATY1pJDmEefMJvCPhZGmZM4qr ubfQ== Received: by 10.68.232.71 with SMTP id tm7mr31419180pbc.118.1354558582422; Mon, 03 Dec 2012 10:16:22 -0800 (PST) Received: from localhost.localdomain ([117.235.125.150]) by mx.google.com with ESMTPS id o11sm8418107pby.8.2012.12.03.10.16.15 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 03 Dec 2012 10:16:21 -0800 (PST) From: "Rajanikanth H.V" To: anton.vorontsov@linaro.org Subject: [PATCH 1/2] ab8500: remove explicit handling of battery type Date: Mon, 3 Dec 2012 23:42:54 +0530 Message-Id: <1354558375-15110-1-git-send-email-rajanikanth.hv@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQlBZZsx76nSVQruhUk3Q2RoawReINZS0Jk3WRiKxwWGY/o1fhpzk2jjCV4SQPZV0PYtfzFR X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121203_131625_295894_B4DC9C30 X-CRM114-Status: GOOD ( 10.26 ) X-Spam-Score: 0.4 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 3.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linaro-dev@lists.linaro.org, linus.walleij@stericsson.com, arnd@arndb.de, patches@linaro.org, francescolavra.fl@gmail.com, linux-kernel@vger.kernel.org, rob.herring@calxeda.com, rajanikanth.hv@stericsson.com, STEricsson_nomadik_linux@list.st.com, lee.jones@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: "Rajanikanth H.V" dt property, 'battery-type' shall be one of supported technology type instead blank. refer:Documentation/devicetree/bindings/power_supply/ab8500/fg.txt for the list of supported types thanks to Francesco Lavra for highlighting missing of_node_put(...) for '3.7-rc5': of git://git.infradead.org/battery-2.6.git Acked-by: Lee Jones Signed-off-by: Rajanikanth H.V --- drivers/power/ab8500_bmdata.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c index 03cc528..2230b2c 100644 --- a/drivers/power/ab8500_bmdata.c +++ b/drivers/power/ab8500_bmdata.c @@ -461,7 +461,6 @@ bmdevs_of_probe(struct device *dev, struct device_node *np_bat_supply; struct abx500_bm_data *bat; const char *btech; - char bat_tech[8]; int i, thermistor; *battery = &ab8500_bm_data; @@ -488,12 +487,10 @@ bmdevs_of_probe(struct device *dev, "stericsson,battery-type", NULL); if (!btech) { dev_warn(dev, "missing property battery-name/type\n"); - strcpy(bat_tech, "UNKNOWN"); - } else { - strcpy(bat_tech, btech); + of_node_put(np_bat_supply); + return -EINVAL; } - - if (strncmp(bat_tech, "LION", 4) == 0) { + if (strncmp(btech, "LION", 4) == 0) { bat->no_maintenance = true; bat->chg_unknown_bat = true; bat->bat_type[BATTERY_UNKNOWN].charge_full_design = 2600; @@ -508,7 +505,7 @@ bmdevs_of_probe(struct device *dev, if (thermistor == NTC_EXTERNAL) { btype->batres_tbl = temp_to_batres_tbl_ext_thermistor; - } else if (strncmp(bat_tech, "LION", 4) == 0) { + } else if (strncmp(btech, "LION", 4) == 0) { btype->batres_tbl = temp_to_batres_tbl_9100; } else {