Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4721040ybi; Tue, 28 May 2019 01:14:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5m6em6Kvd+hzT13IfOyIx07AG+uJn1rYHNGqOtotjWo12pz+VMoU2yPWIwE88yYPGP90H X-Received: by 2002:a17:902:9f83:: with SMTP id g3mr117341653plq.330.1559031258435; Tue, 28 May 2019 01:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559031258; cv=none; d=google.com; s=arc-20160816; b=AHT9EMkKcDddKM8I0NzhaGAGcGAShty6x3CwZcWCGhnH1rMptt8KlYyujvoLzPTJN1 DqormVyKIVidgkUqyB3BMffnJleP/HXUmeJnfMRx2SKIbBE5gp94YasRQMTNnC6ETAYY KtgQW2P1jFCMUusU+u3Ubln23WdpedYIxKNWGnUk355vyDtQLnn7KKvjHCtZF8AAQw/i Ep0k8D7/N5Ko/dQheQ6DxVKeb2Rjzpz58ShDiCbuyI5po/TwiM7RS3PpQSqzIu7gwjDO ZGodl0Lz6aqgk6MlzDOxNN+EzBx5B7Aj028PJ7MH1/+SYtnVcjIbGxMZtCP1bxxXLKVc 7zOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=v7NrxMm57w7Lj3C6AmYNU/Ft8SO/IFxNdPcbPrlySL8=; b=kfnrqP6zKnNhUnm2APFus1ejVxccrquQDZy0TpuMoYdqDqPhZEsF2bacvMJhmGhXRV /LaNzW3LXCsdJ3QjCPFbz4sWWI4xXj0ED8FC2208ShOgOEMiug3rhnGY3Bla1aluqPnP 9HZQV/kBlXrgsYR/nrdHflZGTkVSFrAJoQZ0QwnTtGsnQRJ8MEXlh1UmMgGA9EA0Jops yKgL2xPRd5t3UyLVP/x5EeqgieWubGk32ezqM7R0Ye2K7JMZ6j4lPe7slmC8Wuiif42E 0Gg8e5vM7FrVAUyaszyJ7V3/kMSPMWdMJ7H+VwKkjjLX37dx5OSykz3/vVyl5Qx+KvpU Vslw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g90si16740034plb.282.2019.05.28.01.14.02; Tue, 28 May 2019 01:14:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726524AbfE1ILy (ORCPT + 99 others); Tue, 28 May 2019 04:11:54 -0400 Received: from mga01.intel.com ([192.55.52.88]:17847 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726236AbfE1ILy (ORCPT ); Tue, 28 May 2019 04:11:54 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 01:11:53 -0700 X-ExtLoop1: 1 Received: from pipin.fi.intel.com (HELO pipin) ([10.237.72.175]) by fmsmga001.fm.intel.com with ESMTP; 28 May 2019 01:11:51 -0700 From: Felipe Balbi To: Chunfeng Yun , Greg Kroah-Hartman Cc: Matthias Brugger , Randy Dunlap , Chunfeng Yun , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [v3 PATCH] usb: create usb_debug_root for gadget only In-Reply-To: References: Date: Tue, 28 May 2019 11:11:50 +0300 Message-ID: <87k1ebj8vt.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Then have a function which can be called by both host and gadget to maybe create the directory: 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); } -- balbi