From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754735AbbCLN6q (ORCPT ); Thu, 12 Mar 2015 09:58:46 -0400 Received: from mail.savoirfairelinux.com ([209.172.62.77]:63295 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753174AbbCLN6j (ORCPT ); Thu, 12 Mar 2015 09:58:39 -0400 From: Vivien Didelot To: Greg Kroah-Hartman Cc: Guenter Roeck , linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, Vivien Didelot Subject: [PATCH v3 3/3] sysfs: Document struct attribute_group Date: Thu, 12 Mar 2015 09:58:28 -0400 Message-Id: <1426168708-10836-4-git-send-email-vivien.didelot@savoirfairelinux.com> X-Mailer: git-send-email 2.3.2 In-Reply-To: <1426168708-10836-1-git-send-email-vivien.didelot@savoirfairelinux.com> References: <1426168708-10836-1-git-send-email-vivien.didelot@savoirfairelinux.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guenter Roeck Document variables defined in struct attribute_group to ensure correct usage. Signed-off-by: Guenter Roeck Signed-off-by: Vivien Didelot --- include/linux/sysfs.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index ddad161..99382c0 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -57,6 +57,21 @@ do { \ #define sysfs_attr_init(attr) do {} while (0) #endif +/** + * struct attribute_group - data structure used to declare an attribute group. + * @name: Optional: Attribute group name + * If specified, the attribute group will be created in + * a new subdirectory with this name. + * @is_visible: Optional: Function to return permissions associated with an + * attribute of the group. Will be called repeatedly for each + * attribute in the group. Only read/write permissions as well as + * SYSFS_PREALLOC are accepted. Must return 0 if an attribute is + * not visible. The returned value will replace static permissions + * defined in struct attribute or struct bin_attribute. + * @attrs: Pointer to NULL terminated list of attributes. + * @bin_attrs: Pointer to NULL terminated list of binary attributes. + * Either attrs or bin_attrs or both must be provided. + */ struct attribute_group { const char *name; umode_t (*is_visible)(struct kobject *, -- 2.3.2