From patchwork Wed Nov 28 19:27:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajanikanth HV X-Patchwork-Id: 1818121 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 40C70DF230 for ; Wed, 28 Nov 2012 19:32:54 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TdnKu-0005ge-Gv; Wed, 28 Nov 2012 19:30:20 +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 1TdnKq-0005gG-EY for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2012 19:30:17 +0000 Received: by mail-pb0-f49.google.com with SMTP id un15so8954445pbc.36 for ; Wed, 28 Nov 2012 11:30:13 -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=kbcAsx4aRe4Ju6xY5QbqSzn/uSBpUtOPri1hgjUdfxA=; b=avwjYSe9hi7ELhcRFH7GLnU8HUJRbwAqD7YGosC/VhMmMTEUIioswRIyB60tcRbGYO YquPeEbX/AZWpO0s5McWspmvXaNGGiOiWMDbQAB80BmWRAwaXLImP3quv1P9DqF4Yss4 hG2l9OY+MRaAU3InqvJJqOyUedjBF2EoQlTPrtcKTQMz0812YWjpEAvv1OVvWMW7RUFR DRWv4wQ6Kh9hHCDhM+I1k7yVmpEM9Ongt02MxjaZe87EvXN5phiHfyIumUi05RbBiBJC gR0PNsjenCR6iaNFmoxqlGR/GoCfhR+dCUjpQXFXt3DrkjayYQHkOb/rRgAgeck8WTPy BPZw== Received: by 10.68.136.163 with SMTP id qb3mr60757158pbb.129.1354131013121; Wed, 28 Nov 2012 11:30:13 -0800 (PST) Received: from localhost.localdomain ([117.235.51.54]) by mx.google.com with ESMTPS id wg3sm12879689pbc.28.2012.11.28.11.30.05 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Nov 2012 11:30:12 -0800 (PST) From: "Rajanikanth H.V" To: anton.vorontsov@linaro.org Subject: [PATCH] ab8500: remove explicit handling of battery type Date: Thu, 29 Nov 2012 00:57:45 +0530 Message-Id: <1354130865-6148-1-git-send-email-rajanikanth.hv@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQm/0ru8h6FCLE/fXZ5txcQPKg5QqVklmupoj3i9j3GLXLFLFMDJh5gdRYG4hFn2+Nvaxh32 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121128_143016_598903_0C64A7EA X-CRM114-Status: GOOD ( 12.11 ) 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" property, battery-type shall be one of supported technology type instead blank - refer: Documentation/devicetree/bindings/power_supply/ab8500/fg.txt for the list supported types - this patch appends to ab8500 bm devs DT binding patch set ref: commit-id e0f1abeba5c2d8a2183566717d99294fd1a29c2e git://git.infradead.org/battery-2.6.git - promote ab8500_fg probe to happen before ab8500_btemp probe as btemp driver depends on fuelgauge list, ref: ab8500_fg_get(...) Signed-off-by: Rajanikanth H.V --- drivers/power/Makefile | 2 +- drivers/power/ab8500_bmdata.c | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/power/Makefile b/drivers/power/Makefile index 696e3a9..070c73d 100644 --- a/drivers/power/Makefile +++ b/drivers/power/Makefile @@ -38,7 +38,7 @@ obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o obj-$(CONFIG_BATTERY_JZ4740) += jz4740-battery.o obj-$(CONFIG_BATTERY_INTEL_MID) += intel_mid_battery.o obj-$(CONFIG_BATTERY_RX51) += rx51_battery.o -obj-$(CONFIG_AB8500_BM) += ab8500_bmdata.o ab8500_charger.o ab8500_btemp.o ab8500_fg.o abx500_chargalg.o +obj-$(CONFIG_AB8500_BM) += ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o abx500_chargalg.o obj-$(CONFIG_CHARGER_ISP1704) += isp1704_charger.o obj-$(CONFIG_CHARGER_MAX8903) += max8903_charger.o obj-$(CONFIG_CHARGER_TWL4030) += twl4030_charger.o diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c index 03cc528..f16b60c 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,9 @@ 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); + 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 +504,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 {