From patchwork Mon Jan 5 15:47:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5569251 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 C8806BF6C3 for ; Mon, 5 Jan 2015 15:54:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0CA620166 for ; Mon, 5 Jan 2015 15:54:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 64F6C20154 for ; Mon, 5 Jan 2015 15:54:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753101AbbAEPxu (ORCPT ); Mon, 5 Jan 2015 10:53:50 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:56286 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753915AbbAEPsX (ORCPT ); Mon, 5 Jan 2015 10:48:23 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NHP00JIBO3H9C60@mailout1.w1.samsung.com>; Mon, 05 Jan 2015 15:52:29 +0000 (GMT) X-AuditID: cbfec7f5-b7fc86d0000066b7-ac-54aab245c078 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id BE.70.26295.542BAA45; Mon, 05 Jan 2015 15:48:21 +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 <0NHP00HBJNWDWI80@eusync4.samsung.com>; Mon, 05 Jan 2015 15:48:20 +0000 (GMT) From: Krzysztof Kozlowski To: "Rafael J. Wysocki" , Len Brown , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Pavel Machek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RFC PATCHv2 07/19] mfd: ab8500: Use power_supply_*() API for accessing function attrs Date: Mon, 05 Jan 2015 16:47:50 +0100 Message-id: <1420472882-10463-8-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1420472882-10463-1-git-send-email-k.kozlowski@samsung.com> References: <1420472882-10463-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCLMWRmVeSWpSXmKPExsVy+t/xa7pum1aFGExjtJj05D2zxcSVk5kt Xr8wtNj58C2bxfJ9/YwWmx5fY7W4vGsOm8Xn3iOMFndPHWWzOHP6EqvF6d0lDtweO2fdZffY vELLY9OqTjaPzUvqPbZcbWfx6NuyitFjxerv7B6fN8kFcERx2aSk5mSWpRbp2yVwZSxZ95m1 4AJ3xZYzb9gbGC9wdjFyckgImEi0rHvNDGGLSVy4t56ti5GLQ0hgKaPEte/bWSGcPiaJdc+n sINUsQkYS2xevgSsSkTgCZPE9NaTLCAJZgFDiZ/v/oAVCQskSsxcfxHI5uBgEVCVaF2oCBLm FXCXuLh9AhPENjmJk8cms4LYnAIeEk1/L4CNEQKq+fDsF+sERt4FjAyrGEVTS5MLipPSc430 ihNzi0vz0vWS83M3MUJC8usOxqXHrA4xCnAwKvHwepxYGSLEmlhWXJl7iFGCg1lJhPdV+qoQ Id6UxMqq1KL8+KLSnNTiQ4xMHJxSDYwc3Mxval9sOlswfRN/YuXx80VaVwsZXntJGN3PPlV1 6JQOQ+6d6nf2bHP4eptv2P5vffR5/U52nt1ytzIfddmfvhkruVLlROMKhZCu4hnLxVaIvUhV lN2dERWySyk2frGF9Ln9EstMg1Zxeu47rPT9ut42rsWf+w6Kbv75pT3mjMgzZYMN0w2VWIoz Eg21mIuKEwG78epYJwIAAA== 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 --- 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."