]>
Commit | Line | Data |
---|---|---|
497bc4e8 GKH |
1 | From ad579699c4f0274bf522a9252ff9b20c72197e48 Mon Sep 17 00:00:00 2001 |
2 | From: Shubhrajyoti D <shubhrajyoti@ti.com> | |
3 | Date: Thu, 22 Mar 2012 12:48:06 +0530 | |
4 | Subject: usb: musb: omap: fix the error check for pm_runtime_get_sync | |
5 | ||
6 | From: Shubhrajyoti D <shubhrajyoti@ti.com> | |
7 | ||
8 | commit ad579699c4f0274bf522a9252ff9b20c72197e48 upstream. | |
9 | ||
10 | pm_runtime_get_sync returns a signed integer. In case of errors | |
11 | it returns a negative value. This patch fixes the error check | |
12 | by making it signed instead of unsigned thus preventing register | |
13 | access if get_sync_fails. Also passes the error cause to the | |
14 | debug message. | |
15 | ||
16 | Cc: Kishon Vijay Abraham I <kishon@ti.com> | |
17 | Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com> | |
18 | Signed-off-by: Felipe Balbi <balbi@ti.com> | |
19 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
20 | ||
21 | --- | |
22 | drivers/usb/musb/omap2430.c | 5 +++-- | |
23 | 1 file changed, 3 insertions(+), 2 deletions(-) | |
24 | ||
25 | --- a/drivers/usb/musb/omap2430.c | |
26 | +++ b/drivers/usb/musb/omap2430.c | |
27 | @@ -281,7 +281,8 @@ static void musb_otg_notifier_work(struc | |
28 | ||
29 | static int omap2430_musb_init(struct musb *musb) | |
30 | { | |
31 | - u32 l, status = 0; | |
32 | + u32 l; | |
33 | + int status = 0; | |
34 | struct device *dev = musb->controller; | |
35 | struct musb_hdrc_platform_data *plat = dev->platform_data; | |
36 | struct omap_musb_board_data *data = plat->board_data; | |
37 | @@ -300,7 +301,7 @@ static int omap2430_musb_init(struct mus | |
38 | ||
39 | status = pm_runtime_get_sync(dev); | |
40 | if (status < 0) { | |
41 | - dev_err(dev, "pm_runtime_get_sync FAILED"); | |
42 | + dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status); | |
43 | goto err1; | |
44 | } | |
45 |