From patchwork Fri Feb 27 08:19:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5899211 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2CDF0BF6C3 for ; Fri, 27 Feb 2015 08:28:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 54F36201CE for ; Fri, 27 Feb 2015 08:28:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 54988201E4 for ; Fri, 27 Feb 2015 08:28:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754942AbbB0I2O (ORCPT ); Fri, 27 Feb 2015 03:28:14 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:46601 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754744AbbB0IUk (ORCPT ); Fri, 27 Feb 2015 03:20:40 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NKF00GEQ8P2LZ70@mailout2.w1.samsung.com>; Fri, 27 Feb 2015 08:24:38 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-7f-54f02840dd6c Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id EC.77.26295.04820F45; Fri, 27 Feb 2015 08:18:08 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NKF007VV8HM7X70@eusync1.samsung.com>; Fri, 27 Feb 2015 08:20:36 +0000 (GMT) From: Krzysztof Kozlowski To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Len Brown , Jiri Kosina , David Herrmann , Cezary Jackiewicz , Darren Hart , Support Opensource , Milo Kim , Julian Andres Klode , Marc Dietrich , Greg Kroah-Hartman , linux-acpi@vger.kernel.org, linux-input@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@opensource.wolfsonmicro.com, ac100@lists.launchpad.net, linux-tegra@vger.kernel.org, devel@driverdev.osuosl.org, Linus Walleij , Samuel Ortiz , Lee Jones , linux-arm-kernel@lists.infradead.org, Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Daniel Mack , Haojian Zhuang , Robert Jarzmik Cc: Thomas Gleixner , Pavel Machek , Kyungmin Park , Marek Szyprowski , Krzysztof Kozlowski Subject: [PATCH v5 07/20] mfd: ab8500: Use power_supply_*() API for accessing function attrs Date: Fri, 27 Feb 2015 09:19:48 +0100 Message-id: <1425025201-15926-8-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1425025201-15926-1-git-send-email-k.kozlowski@samsung.com> References: <1425025201-15926-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAy2ReUiTcRjH++09duTibZq9CQotjLTyKuhBYggR/ch/KoZCkLV0qOXVpiON yIwI530kaZaaW/O+0XmWpms2NVMQCg+WCuZ9F141tf8+34fPwwPPl0eIWkk7XnBYpFwRJgsR 0wLStPN58KzXqUWp2+TaYUjuXeSAxphAQtz2NAnpEwsEtPRscKFw0BbUBW6QVpxBwLPCShr6 Ky5AVvVReL+UR0NzbiEJM1Pu0Bs3y4WxtS4EjeY5GjK3dBzQtaUgqBkfouD78joFg025NKwk dSKIX82hobxzhAvxXwsQ6DYqSBj4mG/ZmPtLw8iXLhpKW6YI6DENUJAzaw2mBApMzZHQ+vwb AbU1Lwn4UzVOeZ3ERcuueLTtE4lTKlYo3JgzwsWLS354MjWDi2uLnPHEtI7CNSXxNB4eaqHx fF8fF7/tvo4/vCmzCJonuCtxmMS/0jbpa8duCi4GyEOCVXKFq+SOIKi+uJcT0Wn1cGtGFoua BGrE57HMebZOk0Dtsy3bP1pJq5GAJ2K0iB3VrhL7IZnDat4VoV2LZs6xtTrNnmXDGPhse3kS ZzcQzABixye6ubuWNePHJo3HkrtMMo7scl773lzIXGEzqzv+33Nguw0Ze8xnMDu/nb3niCxO ZcFvlIqE+ehACToij/KPUN4NDPVwUcpClVFhgS7+4aE1aL/yNT3SGjw7EMNDYishZhelIkqm UkaHdiCWR4hthMi8IBUJA2TRMXJF+G1FVIhc2YE4PL5dLBKqGm5YfmfcvJVkb612eXymwdHk q3qhP3FVfUk4Zhfn47H5aF59MIaMkHpISleZOqPedD/+3mWfn2onidWhfKfjY69LEtP6X/k2 pmokO9lKrmQ906DfnDK+O62SYwm/Xeutz7JfrSoTPN3eSH/gbZClbM3W+ywY6354mh3MYlIZ JHN3JhRK2T9JXMac0AIAAA== Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace direct calls to power supply function attributes with wrappers. Wrappers provide safe access in case of unregistering the power supply (e.g. by removing the driver). Replace: - get_property -> power_supply_get_property Signed-off-by: Krzysztof Kozlowski Acked-by: Jonghwa Lee Acked-by: Pavel Machek Acked-by: Lee Jones Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- drivers/mfd/ab8500-sysctrl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c index cfff0b643f1b..d4a4b24be7c6 100644 --- a/drivers/mfd/ab8500-sysctrl.c +++ b/drivers/mfd/ab8500-sysctrl.c @@ -49,7 +49,8 @@ static void ab8500_power_off(void) if (!psy) continue; - ret = psy->get_property(psy, POWER_SUPPLY_PROP_ONLINE, &val); + ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_ONLINE, + &val); if (!ret && val.intval) { charger_present = true; @@ -63,8 +64,8 @@ static void ab8500_power_off(void) /* Check if battery is known */ psy = power_supply_get_by_name("ab8500_btemp"); if (psy) { - ret = psy->get_property(psy, POWER_SUPPLY_PROP_TECHNOLOGY, - &val); + ret = power_supply_get_property(psy, + POWER_SUPPLY_PROP_TECHNOLOGY, &val); if (!ret && val.intval != POWER_SUPPLY_TECHNOLOGY_UNKNOWN) { printk(KERN_INFO "Charger \"%s\" is connected with known battery."