Re: [PATCH RFC v2] usb: musb: omap: fix the error check for pm_runtime_get_sync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shubhrajyoti D <shubhrajyoti@xxxxxx> writes:

> 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 :  Kishon Vijay Abraham I <kishon@xxxxxx>
> Signed-off-by: Shubhrajyoti D <shubhrajyoti@xxxxxx>
> ---
> Compile tested only
>
>  drivers/usb/musb/omap2430.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
> index 2ae0bb3..e5dd18f 100644
> --- a/drivers/usb/musb/omap2430.c
> +++ b/drivers/usb/musb/omap2430.c
> @@ -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;

nit: you might as well drop the '= 0' assignment since it's not needed.

Otherwise, looks right to me.

Acked-by: Kevin Hilman <khilman@xxxxxx>

Kevin

>  	struct device *dev = musb->controller;
>  	struct musb_hdrc_platform_data *plat = dev->platform_data;
>  	struct omap_musb_board_data *data = plat->board_data;
> @@ -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;
>  	}
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux