Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp877264yba; Mon, 1 Apr 2019 19:52:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvuVc28cVVYB6A/qvQSikp2AswRk24RqrCAANkYyWw/bQIevu/6R0f673jeIUrdmIk74iU X-Received: by 2002:aa7:91c8:: with SMTP id z8mr55438309pfa.110.1554173547257; Mon, 01 Apr 2019 19:52:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554173547; cv=none; d=google.com; s=arc-20160816; b=pFbQ1kdM1YuPrlvhfDvk8qF3mNAjcuR+AGgKqpZPSk9ZlPcBzBWTG2gjXucpAAIZYS J4pOO2d4MDRaDLGgLl3CbplDL5hVZ7UqOsrrbq/NcC5KhEjTys3z7G8MI7R0amlg4IFg 5tp0zgXDBPobjG2TR/UhKgTqW/7ZN5j99PPSmJrXhkyk+EWILHk0qhDUSFOxl6ZgjR8X NlRm9icdxlJoQxof5awyuGtz2APKeMe/+BWHEMZqiiLDEzmByoo8iNTDMDv5VTHMLSw2 qzKe/0Za6gyjSYgyJg/ypAHhAb40pGXVittfF05qMcGIds87+Inm/z/k1kIIVl6H3FAd O7TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cdw0h7f6dlrh5aXSLwgzdfQkXS3vqplD119RsMrSKT8=; b=MlET62BKv/PbMjwjcfGRMlGwFIGKdYgR9l6QYpzdOIe0FOlxLy1wyAVzaaYZzJr16x 4+pZ8phvL0DOeJVqdNoo5dqezM4TEDvQK4hwCfUelgzpx0/Agd0UcOWo30hhvVGZhBBA 1aiFdc5cup1OYLz3dmWgOZmA6D44v/wVHzK1qMyGFgx9Dxx1NGeh5JAXhPg10cDOg0GD IJChKKtija7+OXdynzP9ZqDNrsQotlhl+MmOl5ki9njEI7YVWMrQZ/peyhwxipG6b3AX Fq1oQDk2itrNYA7mQEUndLtr7L5hS56pbHL2igOSurcehH2Jtr8tKEb/lpJAnMtZtny7 PZsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fuF5kf2u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si9951054pll.132.2019.04.01.19.52.12; Mon, 01 Apr 2019 19:52:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fuF5kf2u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728877AbfDBCv2 (ORCPT + 99 others); Mon, 1 Apr 2019 22:51:28 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:38362 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbfDBCv1 (ORCPT ); Mon, 1 Apr 2019 22:51:27 -0400 Received: by mail-io1-f66.google.com with SMTP id v4so9649417ioj.5 for ; Mon, 01 Apr 2019 19:51:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cdw0h7f6dlrh5aXSLwgzdfQkXS3vqplD119RsMrSKT8=; b=fuF5kf2uzO6eKCQJoCOImzmtFIl4srGNj+3NVxZ4GlFI+8xf32kbBiXzKQg4lYHh8m 0gHSewx2dwiiLdiEcfQOCi/Iq6omTexQyL/ZJSJNgCi/S07BWWSk907I/9vKv3NKUCGe xt0abv28cYnhe1MXmY0Nw1S3GaFowyabYbMeMZtzcqhYsXc20h/p7dmbGlnQV6/kofn4 x6gMTQ9ER6+hOYcZ5s7cD9YBNd7LCnk75xY7JoMkkrOezsKXogOcbQn6oOTqylh+UVpu LlvcoQPeJnu/r20E5MSI+BZXIlLQHSi8/yrbAV077YTu+qoWiVtbCC4LrstI9F0QHVH5 BSsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cdw0h7f6dlrh5aXSLwgzdfQkXS3vqplD119RsMrSKT8=; b=XoVpDZUcpnnwwYhnB0eYNnlqwMpA/AJyKKTb5ozSU54nLLbZpKvCLBEsgGAMLHA5Rn afdGPcFSYsOH9mWgAKZxLGSrq4ktYhcYLwOzH7RKIckGqMzD8itZKMyFIcX6S69CAOLx 9eSsG2HxNKFcvd2Xa8DtE4dtzrI8DLac/9r7j5Nqq1A+wv6b085miqLEgUwq04U9yS8d 5AfAjLFcuRNoCv29CqgBFrj3zMQXwR/RWNdMHW30RMoFIh1G5ebQD72QvIl2+xmo1mFw sGaHua/Y8OvoAowJXBugKpQcJ1dD87naTBWwHgovx0INlnbtIxJAk2EcOZTtrp25aeCE KxZg== X-Gm-Message-State: APjAAAVEsP+KquucCFkkEYF9j0fK3LJF/KlJE/KhwC4/AIkmngYE3DNb 8Hz0KXdYYoIK/POPTxNJouk= X-Received: by 2002:a5d:8d88:: with SMTP id b8mr29322375ioj.58.1554173487061; Mon, 01 Apr 2019 19:51:27 -0700 (PDT) Received: from ubu (2600-6c48-437f-c81d-984d-b4e8-0abe-7e26.dhcp6.chtrptr.net. [2600:6c48:437f:c81d:984d:b4e8:abe:7e26]) by smtp.gmail.com with ESMTPSA id f197sm7154847itf.5.2019.04.01.19.51.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Apr 2019 19:51:26 -0700 (PDT) Date: Mon, 1 Apr 2019 22:51:24 -0400 From: Kimberly Brown To: Greg Kroah-Hartman , "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org Subject: [PATCH v2 2/8] samples/kobject: Replace foo_ktype's default_attrs field with groups Message-ID: References: <20190322201440.GA30814@ubu-Virtual-Machine> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The kobj_type default_attrs field is being replaced by the default_groups field. Replace foo_ktype's default_attrs field with default_groups and use the ATTRIBUTE_GROUPS macro to create foo_default_groups. This patch was tested by loading the kset-example module and verifying that the sysfs files for the attributes in the default group were created. Signed-off-by: Kimberly Brown --- samples/kobject/kset-example.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c index 401328fd687d..c8010f126808 100644 --- a/samples/kobject/kset-example.c +++ b/samples/kobject/kset-example.c @@ -178,6 +178,7 @@ static struct attribute *foo_default_attrs[] = { &bar_attribute.attr, NULL, /* need to NULL terminate the list of attributes */ }; +ATTRIBUTE_GROUPS(foo_default); /* * Our own ktype for our kobjects. Here we specify our sysfs ops, the @@ -187,7 +188,7 @@ static struct attribute *foo_default_attrs[] = { static struct kobj_type foo_ktype = { .sysfs_ops = &foo_sysfs_ops, .release = foo_release, - .default_attrs = foo_default_attrs, + .default_groups = foo_default_groups, }; static struct kset *example_kset; -- 2.17.1