From patchwork Tue Mar 10 08:27:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5975001 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 8D851BF6C3 for ; Tue, 10 Mar 2015 08:34:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC6E620260 for ; Tue, 10 Mar 2015 08:34:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9EEE20256 for ; Tue, 10 Mar 2015 08:34:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753237AbbCJIeB (ORCPT ); Tue, 10 Mar 2015 04:34:01 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:31151 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752325AbbCJI2H (ORCPT ); Tue, 10 Mar 2015 04:28:07 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NKZ0016VMD7GW10@mailout4.w1.samsung.com>; Tue, 10 Mar 2015 08:31:55 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-14-54feaa7bf281 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id BB.CC.07834.B7AAEF45; Tue, 10 Mar 2015 08:25:31 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NKZ0033KM64IB70@eusync4.samsung.com>; Tue, 10 Mar 2015 08:27:57 +0000 (GMT) From: Krzysztof Kozlowski To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , "Rafael J. Wysocki" , Len Brown , Jiri Kosina , David Herrmann , Cezary Jackiewicz , Darren Hart , Support Opensource , Milo Kim , 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 , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, 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 Cc: Thomas Gleixner , Pavel Machek , Kyungmin Park , Marek Szyprowski , Krzysztof Kozlowski Subject: [PATCH v6 09/22] mfd: ab8500: Use power_supply_*() API for accessing function attrs Date: Tue, 10 Mar 2015 09:27:13 +0100 Message-id: <1425976046-20973-10-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1425976046-20973-1-git-send-email-k.kozlowski@samsung.com> References: <1425976046-20973-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAyWRa0hTcRjG+++cnXM2XB6mrYOkxCQCwRsWvpWY+KX/twrsS0U6dakwL23O UruIYF5zXiuGieJMN83KSd4lzWk6bymzLC+EBl4zdUXec/nt9z7PD54PL0OIa0knJiomXq6M kSmklJA07/WOuycb9oK8Shb8IHfwFw90H7NJSN1dJKFgbpWAtoEtGirGJJBV7gX5+kICRup8 4enb49BaUkHC0rw3DKYu0zDz24Sg+fsKBUU7VTyo6tAgqJ8d58PE+h8+jLWUULDxpBtBplVL wavuKRqqtupIGH1fdiCv7FMw1W+ioKZtnoAB8ygftMsOYM7mg7k1HtrTPhFgrC8m4O+bWX6A K65e98TTHR9IrKnb4ONm7RSNf+QV0thY7YbrDZkUnhxvo/DPoSEal/ZdxUbdI2zKmSTxQv42 hVc7LBRusKSTOLfBgK5Irgv9wuWKqAS50tM/RBj5Tj/Ii+u2u7ezJEtBLcIsJGA49gzXmG6m DlnCjUy/PmAhI2YrEafTmHi2Qszm8rii5642plgfzlil+y85siaG21qdp20HwY4ibnauj7ZZ DuwtbkirR1mIYUj2FLe8ILGhiMWcfv/c4ZgL19dTyLex4CC2Wr+Sh1uXuKnRNZSHRGXoiAEd k6vD4lShEdHeHipZtEodE+ERFhtdjw4/bG1CFT3nuxDLIKmdaOLGXpCYL0tQJUZ3IY4hpI4i k+YgEoXLEpPkythgpVohV3UhHiNwSkH2nTmxM2pdUmvTQ8VwkHL/suOJoAvcWkTngH6YNC4F nK7rlGXYFYgXfZD18c0v0try/MlA52WNv7P8ztmL6prdXF8TnROVHhG4VylOTgtOeNG43R9q f9ei758mil+6b4otGb2lnimfBQ9CvjVZTravq65pNl1SE+8ftYpLnt2WkqpImbcboVTJ/gFS D9qMvwIAAA== 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."