From patchwork Sun Nov 20 17:36:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9438549 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B689B60235 for ; Sun, 20 Nov 2016 17:36:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA470289B2 for ; Sun, 20 Nov 2016 17:36:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BC34289B3; Sun, 20 Nov 2016 17:36:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4487928904 for ; Sun, 20 Nov 2016 17:36:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752553AbcKTRgf (ORCPT ); Sun, 20 Nov 2016 12:36:35 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:59050 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752495AbcKTRge (ORCPT ); Sun, 20 Nov 2016 12:36:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=References:In-Reply-To:Message-Id:Date:Subject: Cc:To:From; bh=aRSfXEiCpq78fx1pTQ+Ui5vhJqaedy3+0omedBwcZ30=; b=Quu3ciV85+qXWE yAZguUL0mPaB4ReO61un2Gd/wihPcab+alEL3lO5XQYSW34R1sDS+qqoFvukSl5yCqEhfrrMJqpEN HmqfQ5IfJq7637f09TQL0v05cgA2BfZPWZV9l3JbDmjSg0AqPeMWe5wo3TmswtVhGCcnFfFORH/U6 uFFVYow0OgKGzkWwivU0m3uzWsmxQ0AopYxxcwBHttdD+gWGJKZ2qdUKc5K09HBB74++vRcgL4n72 z4p+ecuTMJla27PQh1krNJBj30bD8r3oIoUT82teg4mRxqxfpNyv2DpR+uidRPF0L9sD/eOuHraR6 mIbHXOqGo/O2o0Exed5Q==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:42452 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1c8W2Y-0034Gg-Ks; Sun, 20 Nov 2016 17:36:31 +0000 From: Guenter Roeck To: Hardware Monitoring Cc: Jean Delvare , Guenter Roeck Subject: [PATCH 3/7] hwmon: (core) Clarify use of chip attributes Date: Sun, 20 Nov 2016 09:36:24 -0800 Message-Id: <1479663388-2000-3-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1479663388-2000-1-git-send-email-linux@roeck-us.net> References: <1479663388-2000-1-git-send-email-linux@roeck-us.net> X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Describing chip attributes as "attributes which apply to the entire chip" is confusing. Rephrase to "attributes which are not bound to a specific input or output". Also rename hwmon_chip_attr_templates[] to hwmon_chip_attrs[] to indicate that the respective strings strings are not templates but actual attribute names. Signed-off-by: Guenter Roeck --- Documentation/hwmon/hwmon-kernel-api.txt | 2 +- drivers/hwmon/hwmon.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Documentation/hwmon/hwmon-kernel-api.txt b/Documentation/hwmon/hwmon-kernel-api.txt index ef9d74947f5c..562ef44adb5e 100644 --- a/Documentation/hwmon/hwmon-kernel-api.txt +++ b/Documentation/hwmon/hwmon-kernel-api.txt @@ -160,7 +160,7 @@ It contains following fields: * type: The hardware monitoring sensor type. Supported sensor types are * hwmon_chip A virtual sensor type, used to describe attributes - which apply to the entire chip. + * which are not bound to a specific input or output * hwmon_temp Temperature sensor * hwmon_in Voltage sensor * hwmon_curr Current sensor diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index 491231fa0580..112aae60f51f 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c @@ -292,7 +292,11 @@ static struct attribute *hwmon_genattr(struct device *dev, return a; } -static const char * const hwmon_chip_attr_templates[] = { +/* + * Chip attributes are not attribute templates but actual sysfs attributes. + * See hwmon_genattr() for special handling. + */ +static const char * const hwmon_chip_attrs[] = { [hwmon_chip_temp_reset_history] = "temp_reset_history", [hwmon_chip_in_reset_history] = "in_reset_history", [hwmon_chip_curr_reset_history] = "curr_reset_history", @@ -429,7 +433,7 @@ static const char * const hwmon_pwm_attr_templates[] = { }; static const char * const *__templates[] = { - [hwmon_chip] = hwmon_chip_attr_templates, + [hwmon_chip] = hwmon_chip_attrs, [hwmon_temp] = hwmon_temp_attr_templates, [hwmon_in] = hwmon_in_attr_templates, [hwmon_curr] = hwmon_curr_attr_templates, @@ -441,7 +445,7 @@ static const char * const *__templates[] = { }; static const int __templates_size[] = { - [hwmon_chip] = ARRAY_SIZE(hwmon_chip_attr_templates), + [hwmon_chip] = ARRAY_SIZE(hwmon_chip_attrs), [hwmon_temp] = ARRAY_SIZE(hwmon_temp_attr_templates), [hwmon_in] = ARRAY_SIZE(hwmon_in_attr_templates), [hwmon_curr] = ARRAY_SIZE(hwmon_curr_attr_templates),