From: Felipe Balbi <balbi@ti.com>
To: George Cherian <george.cherian@ti.com>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<balbi@ti.com>, <gregkh@linuxfoundation.org>,
<mpa@pengutronix.de>
Subject: Re: [PATCH] usb: musb: dsps: Remove debugfs entry in musb_platform_exit
Date: Mon, 5 May 2014 10:38:04 -0500 [thread overview]
Message-ID: <20140505153803.GD17875@saruman.home> (raw)
In-Reply-To: <1399300384-4179-1-git-send-email-george.cherian@ti.com>
[-- Attachment #1: Type: text/plain, Size: 2455 bytes --]
On Mon, May 05, 2014 at 08:03:04PM +0530, George Cherian wrote:
> Remove the dsps_debugfs entry as part of musb_platform_exit().
> Without this MUSB never gets probed if compiled built-in.
>
> Signed-off-by: George Cherian <george.cherian@ti.com>
> ---
> drivers/usb/musb/musb_dsps.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
> index 9d9acaa..9876374 100644
> --- a/drivers/usb/musb/musb_dsps.c
> +++ b/drivers/usb/musb/musb_dsps.c
> @@ -482,6 +482,7 @@ static int dsps_musb_exit(struct musb *musb)
> struct dsps_glue *glue = dev_get_drvdata(dev->parent);
>
> del_timer_sync(&glue->timer);
> + debugfs_remove_recursive(glue->dbgfs_root);
already fixed:
commit 0fca91b8a446d4a38b8f3d4772c4a8665ebcd7b2
Author: Daniel Mack <zonque@gmail.com>
Date: Wed Apr 2 11:46:51 2014 +0200
usb: musb: dsps: move debugfs_remove_recursive()
When the platform initialization fails due to missing resources, it will
return -EPROBE_DEFER after dsps_musb_init() has been called.
dsps_musb_init() calls dsps_musb_dbg_init() to allocate the debugfs
nodes. At a later point in time, the probe will be retried, and
dsps_musb_dbg_init() will be called again. debugfs_create_dir() will
fail this time, as the node already exists, and so the entire device
probe will fail with -ENOMEM.
Fix this by moving debugfs_remove_recursive() from dsps_remove() to the
plaform's exit function, so it will be cleanly torn down when the probe
fails. It also feels more natural this way, as .exit is the counterpart
to .init.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 3372ded..e2fd263 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -470,8 +470,9 @@ static int dsps_musb_exit(struct musb *musb)
struct dsps_glue *glue = dev_get_drvdata(dev->parent);
del_timer_sync(&glue->timer);
-
usb_phy_shutdown(musb->xceiv);
+ debugfs_remove_recursive(glue->dbgfs_root);
+
return 0;
}
@@ -708,8 +709,6 @@ static int dsps_remove(struct platform_device *pdev)
pm_runtime_put(&pdev->dev);
pm_runtime_disable(&pdev->dev);
- debugfs_remove_recursive(glue->dbgfs_root);
-
return 0;
}
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
parent reply other threads:[~2014-05-05 15:38 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1399300384-4179-1-git-send-email-george.cherian@ti.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140505153803.GD17875@saruman.home \
--to=balbi@ti.com \
--cc=george.cherian@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mpa@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®