From patchwork Thu Mar 12 07:44:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5991231 Return-Path: X-Original-To: patchwork-linux-input@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 D8BE6BF910 for ; Thu, 12 Mar 2015 07:45:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A029F20381 for ; Thu, 12 Mar 2015 07:45:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4005203E5 for ; Thu, 12 Mar 2015 07:45:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753186AbbCLHpD (ORCPT ); Thu, 12 Mar 2015 03:45:03 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:64795 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751982AbbCLHo5 (ORCPT ); Thu, 12 Mar 2015 03:44:57 -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 <0NL300EE69PKWG50@mailout2.w1.samsung.com>; Thu, 12 Mar 2015 07:48:56 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-6f-550143677906 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id E3.FA.07834.76341055; Thu, 12 Mar 2015 07:42:31 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NL300KWS9IOZC60@eusync2.samsung.com>; Thu, 12 Mar 2015 07:44:56 +0000 (GMT) From: Krzysztof Kozlowski To: Jiri Kosina , Henrik Rydberg , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , linux-pm@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [RESEND PATCH v6 06/22] power_supply: sysfs: Use power_supply_*() API for accessing function attrs Date: Thu, 12 Mar 2015 08:44:04 +0100 Message-id: <1426146260-30081-7-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1426146260-30081-1-git-send-email-k.kozlowski@samsung.com> References: <1426146260-30081-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplluLIzCtJLcpLzFFi42I5/e/4Fd10Z8ZQg5fz+SwmPXnPbDFx5WRm i91zFrNYvH5haHHz0zdWi8u75rBZfO49wmhx4ts0JovTu0scOD0+r3rF6rFz1l12j80rtDw2 repk8+jbsorR48yCI+wenzfJBbBHcdmkpOZklqUW6dslcGV8/7GJpWAZX8XphS+ZGxg/cncx cnBICJhI3Hjk0MXICWSKSVy4t56ti5GLQ0hgKaPElvm9bCAJIYE+JokJ8zRBbDYBY4nNy5eA FYkIzGeS6F91ghUkwSxgKPHz3R92EFtYIFdiReN+JhCbRUBVYse5Y2A2r4C7xIPr15kgtslJ nDw2mRXkCE4BD4nXi3ggdrlLzFz2iX0CI+8CRoZVjKKppckFxUnpuYZ6xYm5xaV56XrJ+bmb GCFB92UH4+JjVocYBTgYlXh4I/oYQoVYE8uKK3MPMUpwMCuJ8HJYMYYK8aYkVlalFuXHF5Xm pBYfYmTi4JRqYFTyNb3z7yuv4MfpH39o8nxqfh70OoJ1zdHNp3tf/Kp/st7EOL3m+0l3y6XN 7muXJp+o/3Yj5cqDTqncXc9Utm7+oFM7+ZWhsYPzre63d2Ltjb5uN0j7aGWSeMtk1+E9J/TY LjzeI3FdPfuT9Qdlngdb60+Y6ITvbrinuzh0W7uAkmOup1hOyBolluKMREMt5qLiRACF1a8w GAIAAA== Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@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 - set_property -> power_supply_set_property - property_is_writeable -> power_supply_property_is_writeable Signed-off-by: Krzysztof Kozlowski Acked-by: Jonghwa Lee Acked-by: Pavel Machek Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Sebastian Reichel --- drivers/power/power_supply_sysfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index 62653f50a524..f817aab80813 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c @@ -76,7 +76,7 @@ static ssize_t power_supply_show_property(struct device *dev, if (off == POWER_SUPPLY_PROP_TYPE) { value.intval = psy->type; } else { - ret = psy->get_property(psy, off, &value); + ret = power_supply_get_property(psy, off, &value); if (ret < 0) { if (ret == -ENODATA) @@ -125,7 +125,7 @@ static ssize_t power_supply_store_property(struct device *dev, value.intval = long_val; - ret = psy->set_property(psy, off, &value); + ret = power_supply_set_property(psy, off, &value); if (ret < 0) return ret; @@ -223,7 +223,7 @@ static umode_t power_supply_attr_is_visible(struct kobject *kobj, if (property == attrno) { if (psy->property_is_writeable && - psy->property_is_writeable(psy, property) > 0) + power_supply_property_is_writeable(psy, property) > 0) mode |= S_IWUSR; return mode;