Re: [PATCH] ehci-omap: fix .remove and failure handling path of .probe

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

 



On Thu, Jul 28, 2011 at 10:48 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> On Thu, 28 Jul 2011 tom.leiming@xxxxxxxxx wrote:
>
>> From: Ming Lei <tom.leiming@xxxxxxxxx>
>>
>> Obviously, disabling & put regulator and iounmap(hcd->regs)
>> are missed in .remove and failure handling path of .probe,
>> so add them.
>>
>> Signed-off-by: Ming Lei <tom.leiming@xxxxxxxxx>
>> ---
>>  drivers/usb/host/ehci-omap.c |   16 ++++++++++++++++
>>  1 files changed, 16 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
>> index 55a57c2..23dc8769 100644
>> --- a/drivers/usb/host/ehci-omap.c
>> +++ b/drivers/usb/host/ehci-omap.c
>> @@ -98,6 +98,18 @@ static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port)
>>       }
>>  }
>>
>> +static void disable_put_regulator(
>> +             struct ehci_hcd_omap_platform_data *pdata)
>> +{
>> +     int i;
>> +
>> +     for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
>> +             if (pdata->regulator[i]) {
>> +                     regulator_disable(pdata->regulator[i]);
>> +                     regulator_put(pdata->regulator[i]);
>> +             }
>> +     }
>> +}
>>
>>  /* configure so an HC device and id are always provided */
>>  /* always called with process context; sleeping is OK */
>> @@ -231,6 +243,8 @@ err_add_hcd:
>>       omap_usbhs_disable(dev);
>>
>>  err_enable:
>> +     disable_put_regulator(pdata);
>> +     iounmap(hcd->regs);
>>       usb_put_hcd(hcd);
>>
>>  err_io:
>
> Doesn't iounmap() belong after the err_io label?  The ioremap() call is
> made before usb_create_hcd() gets called.  (And if that line is moved,
> the argument should be changed to regs instead of hcd->regs.)

Yes, you are right, will update it.

thanks,
-- 
Ming Lei
--
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