Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5121556ybi; Tue, 4 Jun 2019 01:25:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFgPZSUUp8aR8oMmoC1ozeEvF+TUApnbQPHBU74ypxXTdUs6ZOhf5Rl+FI4RkT8nTywvUi X-Received: by 2002:a17:90a:192:: with SMTP id 18mr35689157pjc.107.1559636736281; Tue, 04 Jun 2019 01:25:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559636736; cv=none; d=google.com; s=arc-20160816; b=u7GlaknIfzUMhjCOCuR2BHwJ51xIUW8mvypfOhTP/h4aDwKvKRI6qedtM64Mq9Yf/O BZnWdlpnA/SmiFQZRSv3++AySVwVQMUuZos4bTFSdhCr4oiNppsOogAwXYTlRgMaAsAO 3cg1d7kXWfzNe+Jx9jL5XJmHJYTEQcCRMpT+fFxSJIcqgy8dN8YtoJVlIuuZWFHR01aw lek+5CZP9z4kukxYEqXg8bG/kkrFzqEIXCs8nnvMUjRl8S0Gc0f/ecolNJwCQ7OmEXJi UmbaDQ5W4+r5Gzuqrvp6SeIvCanmHYE6zcJDrBSa86/0I7v6H1k8kkakAQez+mzNZxGL Vvlg== 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=3hbifJdOy2mZAfMiFuosy5Rm9kCzxhLTrlhXipvn7n8=; b=rgjY5w7bw2UtOt/vb+keDe1J1Z+n01+gj+W25RjQm4C5u1LuMZntUCQXWmEZs7kLV4 TYLyrm7NMCtoCI/pTru9eBT+Gd9GPBei/zZ292sKkHHY6iBM0wX4zMxjFrUWsNxTV7Ms 9ZI3ihIEWUdkqmFspeg2A1mjUuE12z+C9sv6EJV24baaeFVg8vFEt7UBr7uWXhRYiBo4 OXyRk3y3VVCOJOix33d6+sXcGoS1ZrlGgVQGLDQXPYHGSQGrhTbEP1WgilFEcC1AT1HP SNjZrfQJ9TZPJkCk0MqN109NemPHNZeoBJ62/cRJRLHYrCSiK5UC4BJquQrL7FMqs7mo aFFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pw0FhfzT; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay11si5528320plb.263.2019.06.04.01.25.20; Tue, 04 Jun 2019 01:25:36 -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=@kernel.org header.s=default header.b=pw0FhfzT; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727023AbfFDIYL (ORCPT + 99 others); Tue, 4 Jun 2019 04:24:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:36216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726826AbfFDIYK (ORCPT ); Tue, 4 Jun 2019 04:24:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5C76423CCA; Tue, 4 Jun 2019 08:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559636649; bh=6slerfuNDoj7Is3gV1c++tUMoScJL8Np9rrWGf3bwEA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pw0FhfzT3SowGqAs0l+j0iJWvItPv9FKYOSML2mpYzvbDof5UrR+5denSGgQQVuki fFuryBzfBU4uCZOyvIOnnbCd5c6MKY9rHsQvHf9KfeS8aq2Sn6NX0RYuYn/x3dQDcF yDZh82G+aEB+uVzt6qhfr5ir0z309DLzk/ERXiMU= Date: Tue, 4 Jun 2019 10:24:07 +0200 From: Greg Kroah-Hartman To: Felipe Balbi Cc: Chunfeng Yun , Matthias Brugger , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH v4] usb: create usb_debug_root for gadget only Message-ID: <20190604082407.GA3783@kroah.com> References: <1559633647-29040-1-git-send-email-chunfeng.yun@mediatek.com> <20190604073706.GA25045@kroah.com> <87k1e123mc.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k1e123mc.fsf@linux.intel.com> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 04, 2019 at 10:47:55AM +0300, Felipe Balbi wrote: > > Hi, > > Greg Kroah-Hartman writes: > >> +struct dentry *usb_debugfs_init(void) > >> +{ > >> + if (!usb_debug_root) > >> + usb_debug_root = debugfs_create_dir("usb", NULL); > >> + > >> + atomic_inc(&usb_debug_root_refcnt); > >> + > >> + return usb_debug_root; > >> +} > >> +EXPORT_SYMBOL_GPL(usb_debugfs_init); > >> + > >> +void usb_debugfs_cleanup(void) > >> +{ > >> + if (atomic_dec_and_test(&usb_debug_root_refcnt)) { > >> + debugfs_remove_recursive(usb_debug_root); > >> + usb_debug_root = NULL; > >> + } > >> +} > >> +EXPORT_SYMBOL_GPL(usb_debugfs_cleanup); > > > > Only remove the debugfs subdir if the usbcore module is removed. Create > > the debugfs subdir when the usbcore module is loaded. No need for any > > reference counting of any sort at all. No need to overthink this :) > > There is a slight need to overthink. He wants to use the same directory > for gadget-only builds too :-) Again, that's fine, this file will be loaded for those builds as well, right? Otherwise, how would this code even be present? :) thanks, greg k-h