Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3342784rwb; Sun, 25 Sep 2022 05:02:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM72/Qp/9iRTR4UvRCroAzl4kx1DHS/t0FUeySLiXYb+sagjh8TRR1LVEDoeU1T11PvHCTis X-Received: by 2002:a05:6402:33c5:b0:447:e4a3:c930 with SMTP id a5-20020a05640233c500b00447e4a3c930mr17479680edc.401.1664107351998; Sun, 25 Sep 2022 05:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664107351; cv=none; d=google.com; s=arc-20160816; b=y8IgNmyvOsICDdMBePbwnE9Kw/Tq3e28CBnSYLP1LRnTHguogUI6bfp45oPkdqxmGD BT9JCgF3khx7QjQBKzTlgZo52RcDXU3GVSRkbVnbFuYrzCUeRUH3K7Im8owir46sKngH 16+ID11cTC2PWIB5PweiJIF6q4ZuPRdu1+F93arYtylFpnMkl1KXDC2awyiPbDdyohdb p96psnPD4mVDZN3oZEIreIg/hu3cm4K29wo6v5sL+VcuA00lDFHlSL5Rj+H4q/UOKFE0 na2Kl/rM57Ml0BG9OZtvSHIEbvjnVaeK7NZ8NN2F+Vp8tW5BZ3+sxeZlf8ugRdJmkc0E X0kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=xOAp3D7Qsoj7B5COukhspiXgwSJ86i9kCNEp1eDsLxg=; b=LywjspcJhxI/LRVf43c1hQUxnaHKNbs4i5/lIBI+OsK2Lo/nBFnUdSueI228Do5Qvo wFoQEPzn4+VI41RcQQIy4u8b4BK8sRc/GW30Wlh1db3QY/8rSwUz0LB7Ik45lYvAnTK0 2tFM6zBnu8Y1ly2ucH+UTk3MJnZc66fxBgxtQ8xn5rdXri5e4m3BZY9f3cgtj1l8U83I it3ltJeEaW9b7gjD/1NRF9kzYMtE2N8JYrac7qf1PD8J05aIDEagdkfTnai3URo3cs1l cccGagaJf5re1Pk1XmEe3lP0n0+9S/7yAJBMczkp32Q3OCrah2jlKaN1YQ3VEehg/8qq 8PQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=cmubWN1F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw19-20020a1709066a1300b007413f3cdd18si8666180ejc.238.2022.09.25.05.02.05; Sun, 25 Sep 2022 05:02:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=cmubWN1F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231841AbiIYL0k (ORCPT + 99 others); Sun, 25 Sep 2022 07:26:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbiIYL0i (ORCPT ); Sun, 25 Sep 2022 07:26:38 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4E2518388; Sun, 25 Sep 2022 04:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1664105181; bh=49VdDnQFxc/vEg9QiBmQxGXhsqXNNFtIXiRzbT/Yf1M=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=cmubWN1F35JAhLZVOCWE8L668RVF0aRkLjxQ9ks5noJJUeBauh0i/fZlf0fzSGP6Z JzRAzVFPgybJF2DsBU0Cw5LK+TBbhsWjObpwvFuXX6muolhT0lKJjdBZLvLLVd2N1U DyblofhMsM7It4FD4PlX51vptjfgHm+1uEH3tmug= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.20.60] ([92.116.188.118]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MVvPJ-1omd2W0tV7-00Rreo; Sun, 25 Sep 2022 13:26:21 +0200 Message-ID: <9534d64c-0236-29db-4e15-860d458207c8@gmx.de> Date: Sun, 25 Sep 2022 13:26:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH 1/2] video: fbdev: gbefb: Convert to use dev_groups Content-Language: en-US To: Jiasheng Jiang , broonie@kernel.org, maarten.lankhorst@linux.intel.com, daniel.vetter@ffwll.ch Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20220902025555.3833920-1-jiasheng@iscas.ac.cn> From: Helge Deller In-Reply-To: <20220902025555.3833920-1-jiasheng@iscas.ac.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:CbGdJazMXcBcACvJwi7UoeY+qSb8dv4KFFaaWwGSQtND2V8usUE wpmM08CNu21olSuvvtu0O5vkJ0wp4Mt70YSG01LlQgRinNxy4twf08zyhC6FHpdUkZ+OQuw j2ewYfOs54eJgkMhmtEmx9hvo2++91EXkUbaSdm7SXmHxFuXFb6saJVu6aTvXbO3yXl7xeD G5BIZMFh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gDBpkyKIQaR5TDn5chMfZwxBoNgY+ ITwofqGORtjVBwJFQ0d9pOrBTYcdVw8zxoOdi/azYEbgoZrkeb2IM9zPf7oZsD7yNqZ3kRfeT +h5SrdI5+FM/Lm7KzzvS5g3oe/01REWkOLgdfPCJZy/UfXqEJSj49ZTcDz5tN7/YHbTetU7dO PPoaVO57vh/LvZFuXR9gK7Ttii X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/2/22 04:55, Jiasheng Jiang wrote: > The driver core supports the ability to handle the creation and removal > of device-specific sysfs files in a race-free manner. Moreover, it can > guarantee the success of creation. Therefore, it should be better to > convert to use dev_groups. applied. Thanks! > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") This Fixes: lines doesn't make sense. I dropped it. Helge > Signed-off-by: Jiasheng Jiang > --- > drivers/video/fbdev/gbefb.c | 20 +++++++------------- > 1 file changed, 7 insertions(+), 13 deletions(-) > > diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c > index 6b4d5a7f3e15..1582c718329c 100644 > --- a/drivers/video/fbdev/gbefb.c > +++ b/drivers/video/fbdev/gbefb.c > @@ -1072,17 +1072,12 @@ static ssize_t gbefb_show_rev(struct device *dev= ice, struct device_attribute *at > > static DEVICE_ATTR(revision, S_IRUGO, gbefb_show_rev, NULL); > > -static void gbefb_remove_sysfs(struct device *dev) > -{ > - device_remove_file(dev, &dev_attr_size); > - device_remove_file(dev, &dev_attr_revision); > -} > - > -static void gbefb_create_sysfs(struct device *dev) > -{ > - device_create_file(dev, &dev_attr_size); > - device_create_file(dev, &dev_attr_revision); > -} > +static struct attribute *gbefb_attrs[] =3D { > + &dev_attr_size.attr, > + &dev_attr_revision.attr, > + NULL, > +}; > +ATTRIBUTE_GROUPS(gbefb); > > /* > * Initialization > @@ -1221,7 +1216,6 @@ static int gbefb_probe(struct platform_device *p_d= ev) > } > > platform_set_drvdata(p_dev, info); > - gbefb_create_sysfs(&p_dev->dev); > > fb_info(info, "%s rev %d @ 0x%08x using %dkB memory\n", > info->fix.id, gbe_revision, (unsigned)GBE_BASE, > @@ -1248,7 +1242,6 @@ static int gbefb_remove(struct platform_device* p_= dev) > gbe_turn_off(); > arch_phys_wc_del(par->wc_cookie); > release_mem_region(GBE_BASE, sizeof(struct sgi_gbe)); > - gbefb_remove_sysfs(&p_dev->dev); > framebuffer_release(info); > > return 0; > @@ -1259,6 +1252,7 @@ static struct platform_driver gbefb_driver =3D { > .remove =3D gbefb_remove, > .driver =3D { > .name =3D "gbefb", > + .dev_groups =3D gbefb_groups, > }, > }; >