From patchwork Tue May 18 16:20:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 441641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43AF7C433B4 for ; Tue, 18 May 2021 16:20:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24D81610E9 for ; Tue, 18 May 2021 16:20:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350578AbhERQWQ (ORCPT ); Tue, 18 May 2021 12:22:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:52680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350575AbhERQWP (ORCPT ); Tue, 18 May 2021 12:22:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EDE9A6100C; Tue, 18 May 2021 16:20:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621354857; bh=XIGEtCBAVOsvBYyHLVCSkQNG9QA4H4fhRpx7NN92vcQ=; h=From:To:Cc:Subject:Date:From; b=MfkqktOaMxm8q3NhWLZCU9bMtGcJQnRNJdXIHurVtvHKnIq7KTsqZjh6+66KFsh+/ REamdmREXExRGcHtOKz/a27XJ+eGs8NQTIvHoUQvsmX3sbT0OmmXyL7lh0tGAxfuLR fv3hJ/Uu8dtFP5P+PbG1+u/oLLQyyweAhVRxHI70= From: Greg Kroah-Hartman To: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Felipe Balbi Subject: [PATCH] USB: gadget: pxa25x_udc: remove dentry storage for debugfs file Date: Tue, 18 May 2021 18:20:54 +0200 Message-Id: <20210518162054.3697992-1-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org There is no need to store the dentry pointer for a debugfs file that we only use to remove it when the device goes away. debugfs can do the lookup for us instead, saving us some trouble, and making things smaller overall. Cc: Daniel Mack Cc: Haojian Zhuang Cc: Robert Jarzmik Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Acked-by: Daniel Mack Acked-by: Felipe Balbi --- drivers/usb/gadget/udc/pxa25x_udc.c | 4 ++-- drivers/usb/gadget/udc/pxa25x_udc.h | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c index 10324a7334fe..69ef1e669d0c 100644 --- a/drivers/usb/gadget/udc/pxa25x_udc.c +++ b/drivers/usb/gadget/udc/pxa25x_udc.c @@ -1338,10 +1338,10 @@ DEFINE_SHOW_ATTRIBUTE(udc_debug); #define create_debug_files(dev) \ do { \ - dev->debugfs_udc = debugfs_create_file(dev->gadget.name, \ + debugfs_create_file(dev->gadget.name, \ S_IRUGO, NULL, dev, &udc_debug_fops); \ } while (0) -#define remove_debug_files(dev) debugfs_remove(dev->debugfs_udc) +#define remove_debug_files(dev) debugfs_remove(debugfs_lookup(dev->gadget.name, NULL)) #else /* !CONFIG_USB_GADGET_DEBUG_FILES */ diff --git a/drivers/usb/gadget/udc/pxa25x_udc.h b/drivers/usb/gadget/udc/pxa25x_udc.h index ccc6b921f067..aa4b68fd9fc0 100644 --- a/drivers/usb/gadget/udc/pxa25x_udc.h +++ b/drivers/usb/gadget/udc/pxa25x_udc.h @@ -116,10 +116,6 @@ struct pxa25x_udc { struct usb_phy *transceiver; u64 dma_mask; struct pxa25x_ep ep [PXA_UDC_NUM_ENDPOINTS]; - -#ifdef CONFIG_USB_GADGET_DEBUG_FS - struct dentry *debugfs_udc; -#endif void __iomem *regs; }; #define to_pxa25x(g) (container_of((g), struct pxa25x_udc, gadget))