Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4752899ybi; Tue, 28 May 2019 01:51:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZU8+6W9S4/XDi/iVQdP6XUFNDsiPbOkBFudgBCJrAWtggI5uCxQ7RZYUTy31Ee9uGhw+e X-Received: by 2002:a65:4349:: with SMTP id k9mr42801218pgq.243.1559033485964; Tue, 28 May 2019 01:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559033485; cv=none; d=google.com; s=arc-20160816; b=OWESaShgm5qN+NsVKIqO28boHNBU10EWELo7s5DfaGfunj5CXf+pL2KvK6/52NLeCK vQeCokFXHZnSztN6TzGsLjSz6AzwB4jhcS8NaUbwCxP+hpNrsWyMoBf+ag5jQOBXfv+3 ih6gobDbcTCC2SWCihuNLmYrfpJNmx4K3KjCj7B83Wwk9A7Hm7OW+s+K0sA8yFsZx01o ex5rMm3YAd8MVzX8NHxV3jETduJ2w/MqroX//m/IUUP9rhdl5QU6ybe2zvnl160j4gG/ DUwQfSAN5EM61exJsi728ENf6fzvkVbfAZBVR60xIs3GLOeQJfv2e1+7hGr1B1Pj81wZ D/qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=miPGCk+6ssGqAdYlCCsPYCBvWO45G4Y+7VTARJRelJI=; b=Xkc3GRYlsnQPl1/6kEgEsljH5TnzUAuKaXovGCVnDx5JwZxntAHJHIZq/YiEvaLTf4 oxNhksvxNrkqBY18v1G6rIfmk1vZyXGB/UIM1Qsvxftp3vr3SCvlV2rATDZ6FRq8Wnvi PYIdX9UJng3+5APvHVMwbPYCju2TVBcYvsNRNIegQJM0dE1AlGoFoIwCQZEv0DM4sCrI eeKq9m6tIuWTcBuLGimO3DvmSukeZSHXzChFse/GbgAcMzowWgDnfFrHT4SoZSg/1VWM ZbPUfsOC3J7YFNor6mP058i0a4xDk9DGlqfZC0UDFCxFRym4t4WiEEv3AK0jtLPYQHcM G6kg== ARC-Authentication-Results: i=1; mx.google.com; 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 h190si20663993pgc.248.2019.05.28.01.51.09; Tue, 28 May 2019 01:51:25 -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; 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 S1726645AbfE1Itz (ORCPT + 99 others); Tue, 28 May 2019 04:49:55 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:37616 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725943AbfE1Itz (ORCPT ); Tue, 28 May 2019 04:49:55 -0400 X-UUID: 5b9db79e0d1846f5987bb02cc58c0733-20190528 X-UUID: 5b9db79e0d1846f5987bb02cc58c0733-20190528 Received: from mtkcas34.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 613910974; Tue, 28 May 2019 16:49:47 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS33N1.mediatek.inc (172.27.4.75) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 28 May 2019 16:49:45 +0800 Received: from [10.17.3.153] (172.27.4.253) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 28 May 2019 16:49:45 +0800 Message-ID: <1559033385.10179.443.camel@mhfsdcap03> Subject: Re: [v3 PATCH] usb: create usb_debug_root for gadget only From: Chunfeng Yun To: Felipe Balbi CC: Greg Kroah-Hartman , Matthias Brugger , Randy Dunlap , , , , Date: Tue, 28 May 2019 16:49:45 +0800 In-Reply-To: <87k1ebj8vt.fsf@linux.intel.com> References: <87k1ebj8vt.fsf@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Felipe, On Tue, 2019-05-28 at 11:11 +0300, Felipe Balbi wrote: > Hi, > > Chunfeng Yun writes: > > diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c > > index 7fcb9f782931..88b3ee03a12d 100644 > > --- a/drivers/usb/core/usb.c > > +++ b/drivers/usb/core/usb.c > > @@ -1190,7 +1190,7 @@ EXPORT_SYMBOL_GPL(usb_debug_root); > > > > static void usb_debugfs_init(void) > > { > > - usb_debug_root = debugfs_create_dir("usb", NULL); > > + usb_debug_root = debugfs_create_dir(USB_DEBUG_ROOT_NAME, NULL); > > debugfs_create_file("devices", 0444, usb_debug_root, NULL, > > &usbfs_devices_fops); > > } > > might be a better idea to move this to usb common. Good idea, I forgot there is a common file. > Then have a function > which can be called by both host and gadget to maybe create the > directory: I'll try it. Thanks a lot > > static struct dentry *usb_debug_root; > > struct dentry *usb_debugfs_init(void) > { > if (!usb_debug_root) > usb_debug_root = debugfs_create_dir("usb", NULL); > > return usb_debug_root; > } > > > Then usb core would be updated to something like: > > static void usb_core_debugfs_init(void) > { > struct dentry *root = usb_debugfs_init(); > > debugfs_create_file("devices", 0444, root, NULL, &usbfs_devices_fops); > } >