From nobody Wed Jul 1 06:47:50 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AE17C433EF for ; Tue, 28 Dec 2021 13:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232280AbhL1NNa (ORCPT ); Tue, 28 Dec 2021 08:13:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232128AbhL1NN3 (ORCPT ); Tue, 28 Dec 2021 08:13:29 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56E4CC061574 for ; Tue, 28 Dec 2021 05:13:29 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D491B61193 for ; Tue, 28 Dec 2021 13:13:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A34B1C36AE8; Tue, 28 Dec 2021 13:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1640697208; bh=IY1JSY+ns2iXA1O9Jn1pf+rlk1MoRrQelWyTgIJQcKs=; h=From:To:Cc:Subject:Date:From; b=xEptiuoBRrGHiJ6bC9EXO3r/UUL/rHZsDi4iTq9m0PXV3Vw2zNKB+VWscjigOKjwo gu/xBJagh2jVRcuFjrbNAwt9EDuTDt/L/ZHh6v3vArIc1ghbjCIRAfydSsHIvF5TZI Da+jaPxZr0bRBCB7b1u4VbHP84JOVSZWfWMPeS8A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman Subject: [PATCH] UIO: use default_groups in kobj_type Date: Tue, 28 Dec 2021 14:13:19 +0100 Message-Id: <20211228131319.249324-1-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1962; h=from:subject; bh=IY1JSY+ns2iXA1O9Jn1pf+rlk1MoRrQelWyTgIJQcKs=; b=owGbwMvMwCRo6H6F97bub03G02pJDImneXPv2mSHxh/yOxP1eJ/08Reb/q6ZyrUkhEHsr7yfdsg2 nksCHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjARCwmGeVo2X74Ypb5Zb+N9XfwCR/ u+xdY1NQzzbDZe26FrdXGVffkz9Uxp26oIJ95MAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the UIO code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Signed-off-by: Greg Kroah-Hartman --- drivers/uio/uio.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index ea96e319c8a0..43afbb7c5ab9 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@ -83,13 +83,14 @@ static struct map_sysfs_entry size_attribute =3D static struct map_sysfs_entry offset_attribute =3D __ATTR(offset, S_IRUGO, map_offset_show, NULL); =20 -static struct attribute *attrs[] =3D { +static struct attribute *map_attrs[] =3D { &name_attribute.attr, &addr_attribute.attr, &size_attribute.attr, &offset_attribute.attr, NULL, /* need to NULL terminate the list of attributes */ }; +ATTRIBUTE_GROUPS(map); =20 static void map_release(struct kobject *kobj) { @@ -119,7 +120,7 @@ static const struct sysfs_ops map_sysfs_ops =3D { static struct kobj_type map_attr_type =3D { .release =3D map_release, .sysfs_ops =3D &map_sysfs_ops, - .default_attrs =3D attrs, + .default_groups =3D map_groups, }; =20 struct uio_portio { @@ -178,6 +179,7 @@ static struct attribute *portio_attrs[] =3D { &portio_porttype_attribute.attr, NULL, }; +ATTRIBUTE_GROUPS(portio); =20 static void portio_release(struct kobject *kobj) { @@ -207,7 +209,7 @@ static const struct sysfs_ops portio_sysfs_ops =3D { static struct kobj_type portio_attr_type =3D { .release =3D portio_release, .sysfs_ops =3D &portio_sysfs_ops, - .default_attrs =3D portio_attrs, + .default_groups =3D portio_groups, }; =20 static ssize_t name_show(struct device *dev, --=20 2.34.1