From patchwork Tue Dec 4 12:19:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\"Rajanikanth H.V" X-Patchwork-Id: 13357 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0CF8A23E2A for ; Tue, 4 Dec 2012 12:20:41 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3B22AA1968B for ; Tue, 4 Dec 2012 12:20:40 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so5759607ieb.11 for ; Tue, 04 Dec 2012 04:20:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=fclid1k6iWcchNHjxkkzZZsoGGf4teaRK8T5eFgzW9M=; b=l/fXKtkIsV6JkSqNh2IHVuQumKxlZ05KAY9RHhPWdA6BifK0mdWW8hQbDTG0rlXmhw C41dkjigb16wEHUsudaFt9FHluYMImMWXvIF+1/4E1S1iGWbukT+XcQ6POPxmqdDx2FS p8+3xLms1Fh9vUPPodu1P8Z/JCTyVsYkWm+kX6nSGI7fwOEZcLuwSUffW8bWsfVjX5j7 VcfBSxHsJAwhgGwilEJOKascjoTfGobr4en50jdZLSFGVsvlaswz4s1AO2ZEoXGPHGza XLC2ZYZJW1My4xKakSRoYv3uuFL9y3FuSxxbrPBWSzH0lsybHBw82DDM4025V4YdQvWc tNAQ== Received: by 10.50.187.197 with SMTP id fu5mr2238153igc.70.1354623639557; Tue, 04 Dec 2012 04:20:39 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp261283igt; Tue, 4 Dec 2012 04:20:38 -0800 (PST) Received: by 10.14.207.68 with SMTP id m44mr47860563eeo.40.1354623638112; Tue, 04 Dec 2012 04:20:38 -0800 (PST) Received: from eu1sys200aog118.obsmtp.com (eu1sys200aog118.obsmtp.com [207.126.144.145]) by mx.google.com with SMTP id l1si2093845een.121.2012.12.04.04.20.28 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Dec 2012 04:20:38 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.145 is neither permitted nor denied by best guess record for domain of rajanikanth.hv@stericsson.com) client-ip=207.126.144.145; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.145 is neither permitted nor denied by best guess record for domain of rajanikanth.hv@stericsson.com) smtp.mail=rajanikanth.hv@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob118.postini.com ([207.126.147.11]) with SMTP ID DSNKUL3qiLFbfzfvCa2CPnwgOSxDxo76gaBQ@postini.com; Tue, 04 Dec 2012 12:20:37 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 93C0DB4; Tue, 4 Dec 2012 12:12:09 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id F24F2EEC; Tue, 4 Dec 2012 12:20:19 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 1A0ED24C07C; Tue, 4 Dec 2012 13:20:13 +0100 (CET) Received: from ubuntu12.bnr.st.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 4 Dec 2012 13:20:18 +0100 From: Rajanikanth H.V To: Cc: , , , , , , , , , , Subject: [PATCH 1/2 v2] ab8500: Remove initial "UNKNOWN" battery-type string assignment Date: Tue, 4 Dec 2012 17:49:22 +0530 Message-ID: <1354623562-4712-1-git-send-email-rajanikanth.hv@stericsson.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnhTj825uj4kOkxaCRls2fFCZO126ABAzqkxy6mczTsZ+ugI5mUNm8de8mvjMnLC4eo7CdB From: "Rajanikanth H.V" DT property 'stericsson,battery-type' shall be one of supported technology type 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 {