lkml.org 
[lkml]   [2019]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4] usb: create usb_debug_root for gadget only
Date

Hi,

Greg Kroah-Hartman <gregkh@linuxfoundation.org> 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 :-)

--
balbi

\
 
 \ /
  Last update: 2019-06-04 09:49    [W:0.150 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site