Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: host: uhci: remove dentry pointer for debugfs

There is no need to keep the dentry pointer around for the created
debugfs file, as it is only needed when removing it from the system.
When it is to be removed, ask debugfs itself for the pointer, to save on
storage and make things a bit simpler.

And, no one noticed that a __maybe_unused dentry * in uhci_start()
really was unused, so remove that as it's obviously not needed, and
hasn't been for quite some time.

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org
Link: https://lore.kernel.org/r/20210216144645.3813043-4-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+5 -11
+5 -7
drivers/usb/host/uhci-hcd.c
··· 536 536 uhci->is_initialized = 0; 537 537 spin_unlock_irq(&uhci->lock); 538 538 539 - debugfs_remove(uhci->dentry); 539 + debugfs_remove(debugfs_lookup(uhci_to_hcd(uhci)->self.bus_name, 540 + uhci_debugfs_root)); 540 541 541 542 for (i = 0; i < UHCI_NUM_SKELQH; i++) 542 543 uhci_free_qh(uhci, uhci->skelqh[i]); ··· 578 577 struct uhci_hcd *uhci = hcd_to_uhci(hcd); 579 578 int retval = -EBUSY; 580 579 int i; 581 - struct dentry __maybe_unused *dentry; 582 580 583 581 hcd->uses_new_polling = 1; 584 582 /* Accept arbitrarily long scatter-gather lists */ ··· 590 590 init_waitqueue_head(&uhci->waitqh); 591 591 592 592 #ifdef UHCI_DEBUG_OPS 593 - uhci->dentry = debugfs_create_file(hcd->self.bus_name, 594 - S_IFREG|S_IRUGO|S_IWUSR, 595 - uhci_debugfs_root, uhci, 596 - &uhci_debug_operations); 593 + debugfs_create_file(hcd->self.bus_name, S_IFREG|S_IRUGO|S_IWUSR, 594 + uhci_debugfs_root, uhci, &uhci_debug_operations); 597 595 #endif 598 596 599 597 uhci->frame = dma_alloc_coherent(uhci_dev(uhci), ··· 700 702 uhci->frame, uhci->frame_dma_handle); 701 703 702 704 err_alloc_frame: 703 - debugfs_remove(uhci->dentry); 705 + debugfs_remove(debugfs_lookup(hcd->self.bus_name, uhci_debugfs_root)); 704 706 705 707 return retval; 706 708 }
-4
drivers/usb/host/uhci-hcd.h
··· 381 381 * The full UHCI controller information: 382 382 */ 383 383 struct uhci_hcd { 384 - 385 - /* debugfs */ 386 - struct dentry *dentry; 387 - 388 384 /* Grabbed from PCI */ 389 385 unsigned long io_addr; 390 386