Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp832706pxb; Fri, 22 Apr 2022 12:08:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwatf01JZ3MPcsRm7SjIW5MuxKsP9Gkf4Q1eXPtIxb7deer2EDvaSNJ2qSFVWYdwKz40Wp1 X-Received: by 2002:a17:902:f64f:b0:156:f1cc:b284 with SMTP id m15-20020a170902f64f00b00156f1ccb284mr5980864plg.147.1650654532254; Fri, 22 Apr 2022 12:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650654532; cv=none; d=google.com; s=arc-20160816; b=gJ85ki/YDZzOuRSQoKYH/2g2gHaFmC5SbthDxjuvqKs/Bijda+E2cn3DOKzyF4btlO rp3EFXmOw1hpZXgzocADAi2KWgp5W6iq58BxmbCSEvwbEDE+1vmsP0gGotnB7TOaWOXQ oSk9dbrQx9yi9v9aGbEZ8ACebBi/yhX71RkF3tqIoOxi5jNYwTcRuVNeA8x/jXtsWVCG k2lHcg2shd2yQKNiHZEnk6/k6DqOHZOGnU0KJSZ4I7mhJu8zlPgqX/5Xdg8uhZA3POri gH9tzwH95JYQ5D8N6PvSRas/NYCsjqXoNRNWcO7F53p0qDnElU5ejGemX1jVwaW21LOA mz6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=FzlZWuqpqT4dYFKX9UTFhTlZBNM1KD7eyT6+7FMZ7dE=; b=oBmz8vt1xSB9kf9SWTbDsj36UdgGrR5G0mBuZNf5m2fUfH1MgtJ3QypbI9wyh8wfT8 ZZDTNq+q1mIP22B8POTLBoYukagf/fJUS4OM1l/8GPKD5MYucIJTsvM7oWGZQHEaWCqS bcdPJuKKnBOhF8YuCpSHlu2SmC8OYDor+htxD6g31cuYzJSzWkG1jIZD2bRyotgo4gSk 4jiaf39yEuYblKmiWRiytqN0lhxaN4wpa7wOXiwGn25pRvXgB3IOmSocMsoAWk5suwEI me2ud2jpNPeRIF+VJExSMKSQgi4SsHnoxNZ2aNq1HR83aU8oPo/VtFhb25uFZwiVzb4O szbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=LX5BduKU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e14-20020a170903240e00b0015874d582f5si4904781plo.298.2022.04.22.12.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 12:08:52 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=LX5BduKU; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B5DAE1A0E3B; Fri, 22 Apr 2022 11:27:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233935AbiDVM7N (ORCPT + 99 others); Fri, 22 Apr 2022 08:59:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234011AbiDVM7G (ORCPT ); Fri, 22 Apr 2022 08:59:06 -0400 X-Greylist: delayed 399 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 22 Apr 2022 05:56:11 PDT Received: from mx4.wp.pl (mx4.wp.pl [212.77.101.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8DB45FE3 for ; Fri, 22 Apr 2022 05:56:10 -0700 (PDT) Received: (wp-smtpd smtp.wp.pl 9660 invoked from network); 22 Apr 2022 14:49:28 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1650631768; bh=FzlZWuqpqT4dYFKX9UTFhTlZBNM1KD7eyT6+7FMZ7dE=; h=From:To:Cc:Subject; b=LX5BduKUebu3hJxINq1D1+qf6qLFbjcnrYFczjeHyWDF21d4ZNp3KMtgh/ZO59IuW 176w9+1k6cc3bY3PnD0nfiFiQidj2elSJVZ1gPG49qhwkrp3Hsni6a56uNDGC0iBii vi71ZUiwj/gEayxBxzHj38pEctRjyTe2f1jKp4fU= Received: from unknown (HELO kicinski-fedora-PC1C0HJN) (kubakici@wp.pl@[163.114.132.6]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 22 Apr 2022 14:49:28 +0200 Date: Fri, 22 Apr 2022 05:49:19 -0700 From: Jakub Kicinski To: Kalle Valo Cc: Bernard Zhao , "David S. Miller" , Paolo Abeni , Matthias Brugger , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, bernard@vivo.com Subject: Re: [PATCH] mediatek/mt7601u: add debugfs exit function Message-ID: <20220422054919.6f056300@kicinski-fedora-PC1C0HJN> In-Reply-To: <87k0bhmuh6.fsf@kernel.org> References: <20220422070325.465918-1-zhaojunkui2008@126.com> <87k0bhmuh6.fsf@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-WP-MailID: cfadbedbb822125ed36bbc0826aae61a X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 000000A [4eNk] X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no 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 Fri, 22 Apr 2022 10:45:57 +0300 Kalle Valo wrote: > > When mt7601u loaded, there are two cases: > > First when mt7601u is loaded, in function mt7601u_probe, if > > function mt7601u_probe run into error lable err_hw, > > mt7601u_cleanup didn`t cleanup the debugfs node. > > Second when the module disconnect, in function mt7601u_disconnect, > > mt7601u_cleanup didn`t cleanup the debugfs node. > > This patch add debugfs exit function and try to cleanup debugfs > > node when mt7601u loaded fail or unloaded. Is this actually needed? Looks like wireless has a wiphy debugfs dir now, so the entire thing should get removed recursively when probe fails. The driver is not doing anything special. > > diff --git a/drivers/net/wireless/mediatek/mt7601u/debugfs.c b/drivers/net/wireless/mediatek/mt7601u/debugfs.c > > index 20669eacb66e..1ae3d75d3c9b 100644 > > --- a/drivers/net/wireless/mediatek/mt7601u/debugfs.c > > +++ b/drivers/net/wireless/mediatek/mt7601u/debugfs.c > > @@ -124,17 +124,22 @@ DEFINE_SHOW_ATTRIBUTE(mt7601u_eeprom_param); > > > > void mt7601u_init_debugfs(struct mt7601u_dev *dev) > > { > > - struct dentry *dir; > > - > > - dir = debugfs_create_dir("mt7601u", dev->hw->wiphy->debugfsdir); > > - if (!dir) > > + dev->root_dir = debugfs_create_dir("mt7601u", dev->hw->wiphy->debugfsdir); > > + if (!dev->root_dir) > > return;