Re: [PATCH RFC 2/3] usb: twl6030: fix the error check for omap_usb2_set_comparator

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

 



On Thu, Sep 13, 2012 at 8:26 PM, ABRAHAM, KISHON VIJAY <kishon@xxxxxx> wrote:
> Hi,
>
> On Thu, Sep 13, 2012 at 7:44 PM, Shubhrajyoti D <shubhrajyoti@xxxxxx> 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 <shubhrajyoti@xxxxxx>
>> ---
>> 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?
OK.

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux