Hi,

On Thu, Sep 13, 2012 at 7:44 PM, Shubhrajyoti D <[email protected]> wrote:
> The function omap_usb2_set_comparator may return -ENODEV.
> Use a signed variable to store and check so that the value
> is not wrongly interpreted as a large positive number.
> While at it lets use the err variable to do the same.
>
> Signed-off-by: Shubhrajyoti D <[email protected]>
> ---
> untested
>
>  drivers/usb/otg/twl6030-usb.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c
> index fcadef7..11c22f3 100644
> --- a/drivers/usb/otg/twl6030-usb.c
> +++ b/drivers/usb/otg/twl6030-usb.c
> @@ -312,7 +312,6 @@ static int twl6030_set_vbus(struct phy_companion 
> *comparator, bool enabled)
>
>  static int __devinit twl6030_usb_probe(struct platform_device *pdev)
>  {
> -       u32 ret;
>         struct twl6030_usb      *twl;
>         int                     status, err;
>         struct device_node      *np = pdev->dev.of_node;
> @@ -331,8 +330,8 @@ static int __devinit twl6030_usb_probe(struct 
> platform_device *pdev)
>         twl->comparator.set_vbus        = twl6030_set_vbus;
>         twl->comparator.start_srp       = twl6030_start_srp;
>
> -       ret = omap_usb2_set_comparator(&twl->comparator);
> -       if (ret == -ENODEV) {
> +       err = omap_usb2_set_comparator(&twl->comparator);
> +       if (err == -ENODEV) {

While at that can you just change the above to use IS_ERR?

Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to