From patchwork Tue Mar 10 08:27:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5975371 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CA9599F318 for ; Tue, 10 Mar 2015 08:37:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 044BD200EC for ; Tue, 10 Mar 2015 08:37:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 010102025A for ; Tue, 10 Mar 2015 08:37:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753310AbbCJIf7 (ORCPT ); Tue, 10 Mar 2015 04:35:59 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:36177 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752182AbbCJI2C (ORCPT ); Tue, 10 Mar 2015 04:28:02 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) 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 <0NKZ009WEMDCXE00@mailout2.w1.samsung.com>; Tue, 10 Mar 2015 08:32:00 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-20-54feaa7ec204 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id E2.DC.07834.E7AAEF45; Tue, 10 Mar 2015 08:25:34 +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:59 +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 11/22] power_supply: bq2415x_charger: Use power_supply_*() API for accessing function attrs Date: Tue, 10 Mar 2015 09:27:15 +0100 Message-id: <1425976046-20973-12-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: H4sIAAAAAAAAAyWRW0jTYRjG+/Y/Ko3+TVsfQl6sghLyQEFvkRV44XdVRl5lUkuHGp7a1NKL NCHMmTqPqFl4WK0WTue80JySh7lsKh5Q0JzhCZdpmpqJmrXl3e99nof3uXh4SmKgvfiY+CSF Ml4eK2PdaduedezMY/1eqH9bwwnI618VgfZTDg2ZfxZpKJxbocDct81B7YgU1NX+UPCuiIJB w3koNR6F1spaGr47AqA/c4mDr78sCFqml1ko3tWJQNeej6BxdoyB8bVNBkY+VLKwntuNIHuj goW6bjsHum0DDcMfq5zh5b8s2D9bWHhvdlDQZxtmoGLJA2w5DNhak6Dt6RAFpsYSCrYaZpmr x8nbNT8y1d5Fk3zDOkNaKuwcmdcUccT01oc06rNZMjlmZsmPgQGOvOq9QUzadGJ5PkmTbwU7 LFlpH2VJ02gWTfKa9ChEesv9UqQiNiZFofS7fNc9umSikknc4R+tNs+iDDTOqRHPY+Ec7urA auTmRCkenKpnXSwRXiNsrLmgRu5OzhPhdssb2mWwwlls0mlZl+EpWHi8veLgXAclDCM8O9fL uVIeQiKuzstHLqaFk3i5auH/W7FAcFZGLr1f5417e4oYF7s59Y2NCXq/Ohjbh38iDRJXoQN6 dESRHJGouhcVF+CrksepkuOjfCMS4hrR/sYbzai252InEngkOygeD9sLlTDyFFVqXCfCPCXz FFvynZI4Up6aplAm3FEmxypUnUjEu3lloLSymu5AyZVF78AHQUb17u/sgiGzw+uhtfimZN6n yVgU2GbtnjksVAqeh9TpMx3CVL39tGwoIjjoZXkQziid1qdpDL5b2lObgaFWC17wG78/Eu44 9uVZWWGmeklT1+Gb1ftCKioI04ZIPZ9o+Gad/nZ5ttHrWrhJvKi/LkuX0apoeYAPpVTJ/wFE CZyVwQIAAA== 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 Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- drivers/power/bq2415x_charger.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/power/bq2415x_charger.c b/drivers/power/bq2415x_charger.c index 9b509025d687..d31ccc7935d0 100644 --- a/drivers/power/bq2415x_charger.c +++ b/drivers/power/bq2415x_charger.c @@ -809,7 +809,8 @@ static int bq2415x_notifier_call(struct notifier_block *nb, dev_dbg(bq->dev, "notifier call was called\n"); - ret = psy->get_property(psy, POWER_SUPPLY_PROP_CURRENT_MAX, &prop); + ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_CURRENT_MAX, + &prop); if (ret != 0) return NOTIFY_OK;