From patchwork Sun Nov 20 17:36:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9438559 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 C504760235 for ; Sun, 20 Nov 2016 17:36:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8E2428904 for ; Sun, 20 Nov 2016 17:36:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADB3D289B3; Sun, 20 Nov 2016 17:36:41 +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 39BBB28904 for ; Sun, 20 Nov 2016 17:36:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753086AbcKTRgk (ORCPT ); Sun, 20 Nov 2016 12:36:40 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:59226 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752957AbcKTRgj (ORCPT ); Sun, 20 Nov 2016 12:36:39 -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=xgDwu5fZe0uD9qzwPyTXOVpJpz11QwcIEX4tKiIcFZI=; b=4AU3Knn6a93s2t B7PA7SZ53hIyzxf1Da5oDTHA6fCXodI2vdpDVT0Qmi3WGZRSHCwMnfqhNCobc2IJyEy9UNw3Tnvmu Jpk+mRrWUpKo52FryZaJsmkD0Zi9h/3fOaKVXWChHyB7qAiSUhdMuh+N8Ott/iEBhND9aduILVEuQ xC1N0pdC/JiPSactiLlHVpOk4Nnf9dlTFXZ6Py2C1EwuRNyKtZk55jznNaLxMBlJdlAIJaymdvysd bAf6B0zw5kuiFgoK33fMAa3qUFkOBYiC6nfWooP7fLsb9+nLQ/0DOxu6qUbymwgU0TCCIxJke3f7L 1jry/a0ukA6/Sg6mGTRQ==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:42460 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1c8W2d-0034QR-1P; Sun, 20 Nov 2016 17:36:36 +0000 From: Guenter Roeck To: Hardware Monitoring Cc: Jean Delvare , Guenter Roeck Subject: [PATCH 7/7] hwmon: (core) Rename groups parameter in API to extra_groups Date: Sun, 20 Nov 2016 09:36:28 -0800 Message-Id: <1479663388-2000-7-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 The 'groups' parameter of hwmon_device_register_with_info() and devm_hwmon_device_register_with_info() is only necessary if extra non-standard attributes need to be provided. Rename the parameter to extra_groups and clarify the documentation. Signed-off-by: Guenter Roeck --- Documentation/hwmon/hwmon-kernel-api.txt | 22 +++++++++++----------- drivers/hwmon/hwmon.c | 8 ++++---- include/linux/hwmon.h | 8 ++++---- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Documentation/hwmon/hwmon-kernel-api.txt b/Documentation/hwmon/hwmon-kernel-api.txt index 633fa90909eb..2505ae67e2b6 100644 --- a/Documentation/hwmon/hwmon-kernel-api.txt +++ b/Documentation/hwmon/hwmon-kernel-api.txt @@ -37,14 +37,14 @@ struct device * hwmon_device_register_with_info(struct device *dev, const char *name, void *drvdata, const struct hwmon_chip_info *info, - const struct attribute_group **groups); + const struct attribute_group **extra_groups); struct device * devm_hwmon_device_register_with_info(struct device *dev, - const char *name, - void *drvdata, - const struct hwmon_chip_info *info, - const struct attribute_group **groups); + const char *name, + void *drvdata, + const struct hwmon_chip_info *info, + const struct attribute_group **extra_groups); void hwmon_device_unregister(struct device *dev); void devm_hwmon_device_unregister(struct device *dev); @@ -100,9 +100,9 @@ const char *name Device name void *drvdata Driver private data const struct hwmon_chip_info *info Pointer to chip description. -const struct attribute_group **groups - Null-terminated list of additional sysfs attribute - groups. +const struct attribute_group **extra_groups + Null-terminated list of additional non-standard + sysfs attribute groups. This function returns a pointer to the created hardware monitoring device on success and a negative error code for failure. @@ -287,9 +287,9 @@ Driver-provided sysfs attributes If the hardware monitoring device is registered with hwmon_device_register_with_info or devm_hwmon_device_register_with_info, -it is most likely not necessary to provide sysfs attributes. Only non-standard -sysfs attributes need to be provided when one of those registration functions -is used. +it is most likely not necessary to provide sysfs attributes. Only additional +non-standard sysfs attributes need to be provided when one of those registration +functions is used. The header file linux/hwmon-sysfs.h provides a number of useful macros to declare and use hardware monitoring sysfs attributes. diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c index 8dc0466a9307..58c328f4508d 100644 --- a/drivers/hwmon/hwmon.c +++ b/drivers/hwmon/hwmon.c @@ -659,8 +659,8 @@ EXPORT_SYMBOL_GPL(hwmon_device_register_with_groups); * @dev: the parent device * @name: hwmon name attribute * @drvdata: driver data to attach to created device - * @info: Pointer to hwmon chip information - * @groups - pointer to list of driver specific attribute groups + * @info: pointer to hwmon chip information + * @extra_groups: pointer to list of additional non-standard attribute groups * * hwmon_device_unregister() must be called when the device is no * longer needed. @@ -671,12 +671,12 @@ struct device * hwmon_device_register_with_info(struct device *dev, const char *name, void *drvdata, const struct hwmon_chip_info *chip, - const struct attribute_group **groups) + const struct attribute_group **extra_groups) { if (chip && (!chip->ops || !chip->ops->is_visible || !chip->info)) return ERR_PTR(-EINVAL); - return __hwmon_device_register(dev, name, drvdata, chip, groups); + return __hwmon_device_register(dev, name, drvdata, chip, extra_groups); } EXPORT_SYMBOL_GPL(hwmon_device_register_with_info); diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index 2588e6ee7660..78d59dba563e 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h @@ -377,12 +377,12 @@ struct device * hwmon_device_register_with_info(struct device *dev, const char *name, void *drvdata, const struct hwmon_chip_info *info, - const struct attribute_group **groups); + const struct attribute_group **extra_groups); struct device * devm_hwmon_device_register_with_info(struct device *dev, - const char *name, void *drvdata, - const struct hwmon_chip_info *info, - const struct attribute_group **groups); + const char *name, void *drvdata, + const struct hwmon_chip_info *info, + const struct attribute_group **extra_groups); void hwmon_device_unregister(struct device *dev); void devm_hwmon_device_unregister(struct device *dev);