Skip to content

Commit

Permalink
usb: musb: omap: fix the error check for pm_runtime_get_sync
Browse files Browse the repository at this point in the history
pm_runtime_get_sync returns a signed integer. In case of errors
it returns a negative value. This patch fixes the error check
by making it signed instead of unsigned thus preventing register
access if get_sync_fails. Also passes the error cause to the
debug message.

Cc: stable@vger.kernel.org
Cc:  Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Shubhrajyoti D authored and Felipe Balbi committed Apr 10, 2012
1 parent 8ae8090 commit ad57969
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/usb/musb/omap2430.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ static void musb_otg_notifier_work(struct work_struct *data_notifier_work)

static int omap2430_musb_init(struct musb *musb)
{
u32 l, status = 0;
u32 l;
int status = 0;
struct device *dev = musb->controller;
struct musb_hdrc_platform_data *plat = dev->platform_data;
struct omap_musb_board_data *data = plat->board_data;
Expand All @@ -301,7 +302,7 @@ static int omap2430_musb_init(struct musb *musb)

status = pm_runtime_get_sync(dev);
if (status < 0) {
dev_err(dev, "pm_runtime_get_sync FAILED");
dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status);
goto err1;
}

Expand Down

0 comments on commit ad57969

Please sign in to comment.