From patchwork Fri Nov 30 11:57:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 13312 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 AAB8E23FCD for ; Fri, 30 Nov 2012 11:58:17 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 58D7DA18620 for ; Fri, 30 Nov 2012 11:58:17 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so254592iag.11 for ; Fri, 30 Nov 2012 03:58:17 -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:in-reply-to:references :x-gm-message-state; bh=PK9pWeTBx+4PZcV7OinVXGwuz7TyK4lGSZ5q2Aan7so=; b=pKwUal0V3jC9du7tfUpiHde147z6v4ctAwBDILBK+ASxBpHKzvWQbYo6AIXfVYkSpj IDXOxBD9jCNXBt9OEnBust9DkUkBCiDkBQK3d9BOfDAF9qsjYSYNbcQRjQyMhUt1LKru AQ1Z6NgywUsc6+9lS2IrumagM+3muTsiiFD29SDqy/IRy+IZKK6ldAHSUnlBeAZ3KhFI eyoTSu02SPdMjnK3hDB1VHp3tO4rqbIaFoHspyTxgbyd+AExz1Lz7K+FYKWpTGzMV9RG 3cPRP6JpD6AZl9iJVqDPxENhsXVoQPiDdpDon2mcrtOEXGo0H9ZPXf76V+jZQgVcfu9y 4nnA== Received: by 10.50.152.137 with SMTP id uy9mr734900igb.62.1354276697101; Fri, 30 Nov 2012 03:58:17 -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 n20csp1011296igt; Fri, 30 Nov 2012 03:58:09 -0800 (PST) Received: by 10.216.50.141 with SMTP id z13mr398542web.29.1354276689301; Fri, 30 Nov 2012 03:58:09 -0800 (PST) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by mx.google.com with ESMTPS id d14si2791823wea.97.2012.11.30.03.58.08 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Nov 2012 03:58:09 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.181 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.181; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.181 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wi0-f181.google.com with SMTP id hm9so155978wib.8 for ; Fri, 30 Nov 2012 03:58:08 -0800 (PST) Received: by 10.216.91.80 with SMTP id g58mr209785wef.150.1354276688708; Fri, 30 Nov 2012 03:58:08 -0800 (PST) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id i6sm14966896wix.5.2012.11.30.03.58.07 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Nov 2012 03:58:08 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org Cc: linus.walleij@stericsson.com, arnd@arndb.de, cbou@mail.ru, dwmw2@infradead.org, rajanikanth.hv@linaro.org, Lee Jones Subject: [PATCH 12/12] ab8500_bm: Make the battery Device Tree node reference less cryptic Date: Fri, 30 Nov 2012 11:57:34 +0000 Message-Id: <1354276654-590-13-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1354276654-590-1-git-send-email-lee.jones@linaro.org> References: <1354276654-590-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkJoZfk2uol7rrd44k1+xwSfqoBK86vr3qviauAczCENQwlJiZm2pIK2argN6WZRQadFHUT Let's rename the Device Tree node which contains information about an attached battery to something more easily readable. Signed-off-by: Lee Jones --- drivers/power/ab8500_bmdata.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c index 6b772e5..0bf5236 100644 --- a/drivers/power/ab8500_bmdata.c +++ b/drivers/power/ab8500_bmdata.c @@ -457,18 +457,18 @@ int __devinit ab8500_bm_of_probe(struct device *dev, struct abx500_bm_data *bm) { struct batres_vs_temp *tmp_batres_tbl; - struct device_node *np_bat_supply; + struct device_node *battery_node; const char *btech; int i; /* get phandle to 'battery-info' node */ - np_bat_supply = of_parse_phandle(np, "battery", 0); - if (!np_bat_supply) { + battery_node = of_parse_phandle(np, "battery", 0); + if (!battery_node) { dev_err(dev, "battery node or reference missing\n"); return -EINVAL; } - btech = of_get_property(np_bat_supply, "stericsson,battery-type", NULL); + btech = of_get_property(battery_node, "stericsson,battery-type", NULL); if (!btech) { dev_warn(dev, "missing property battery-name/type\n"); return -EINVAL; @@ -484,7 +484,7 @@ int __devinit ab8500_bm_of_probe(struct device *dev, bm->bat_type[BATTERY_UNKNOWN].normal_vol_lvl = 4200; } - if (of_property_read_bool(np_bat_supply, "thermistor-on-batctrl")) { + if (of_property_read_bool(battery_node, "thermistor-on-batctrl")) { if (strncmp(btech, "LION", 4) == 0) tmp_batres_tbl = temp_to_batres_tbl_9100; else @@ -500,7 +500,7 @@ int __devinit ab8500_bm_of_probe(struct device *dev, for (i = 0; i < bm->n_btypes; ++i) bm->bat_type[i].batres_tbl = tmp_batres_tbl; - of_node_put(np_bat_supply); + of_node_put(battery_node); return 0; }