Return-Path: Received: from mail-wr1-f42.google.com ([209.85.221.42]:35143 "EHLO mail-wr1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726853AbeG2TeA (ORCPT ); Sun, 29 Jul 2018 15:34:00 -0400 Received: by mail-wr1-f42.google.com with SMTP id a3-v6so10281032wrt.2 for ; Sun, 29 Jul 2018 11:02:45 -0700 (PDT) Date: Sun, 29 Jul 2018 19:02:36 +0100 From: Sudip Mukherjee To: Greg Kroah-Hartman Cc: stable@vger.kernel.org, Yoshihiro Shimoda , Simon Horman , Felipe Balbi Subject: request for 4.14-stable: 1990cf7c21ea ("usb: gadget: udc: renesas_usb3: should remove debugfs") Message-ID: <20180729180236.x3mqdzpz4p3ulfbe@debian> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="r3gzazyupqqntonv" Content-Disposition: inline Sender: stable-owner@vger.kernel.org List-ID: --r3gzazyupqqntonv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Greg, This was missing in 4.14-stable. Please apply to your queue. -- Regards Sudip --r3gzazyupqqntonv Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0004-usb-gadget-udc-renesas_usb3-should-remove-debugfs.patch" >From faba31246b3d505cf48e7231758361f32bd938d5 Mon Sep 17 00:00:00 2001 From: Yoshihiro Shimoda Date: Tue, 10 Apr 2018 14:38:50 +0900 Subject: [PATCH] usb: gadget: udc: renesas_usb3: should remove debugfs commit 1990cf7c21ea185cec98c6d45a82c04481261e35 upstream This patch fixes an issue that this driver doesn't remove its debugfs. Fixes: 43ba968b00ea ("usb: gadget: udc: renesas_usb3: add debugfs to set the b-device mode") Cc: # v4.14+ Signed-off-by: Yoshihiro Shimoda Reviewed-by: Simon Horman Signed-off-by: Felipe Balbi Signed-off-by: Sudip Mukherjee --- drivers/usb/gadget/udc/renesas_usb3.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c index 4cfa72cb0a91..c12a1a6554ba 100644 --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -334,6 +334,7 @@ struct renesas_usb3 { struct usb_gadget_driver *driver; struct extcon_dev *extcon; struct work_struct extcon_work; + struct dentry *dentry; struct renesas_usb3_ep *usb3_ep; int num_usb3_eps; @@ -2397,8 +2398,12 @@ static void renesas_usb3_debugfs_init(struct renesas_usb3 *usb3, file = debugfs_create_file("b_device", 0644, root, usb3, &renesas_usb3_b_device_fops); - if (!file) + if (!file) { dev_info(dev, "%s: Can't create debugfs mode\n", __func__); + debugfs_remove_recursive(root); + } else { + usb3->dentry = root; + } } /*------- platform_driver ------------------------------------------------*/ @@ -2406,6 +2411,7 @@ static int renesas_usb3_remove(struct platform_device *pdev) { struct renesas_usb3 *usb3 = platform_get_drvdata(pdev); + debugfs_remove_recursive(usb3->dentry); device_remove_file(&pdev->dev, &dev_attr_role); usb_del_gadget_udc(&usb3->gadget); -- 2.11.0 --r3gzazyupqqntonv--