[U-Boot] [PATCH 02/16] usb: xhci-pci: Clean up the driver a little bit

Simon Glass sjg at chromium.org
Thu Jul 6 04:49:35 UTC 2017


On 23 June 2017 at 11:52, Marek Vasut <marex at denx.de> wrote:
> On 06/23/2017 11:54 AM, Bin Meng wrote:
>> This cleans up the driver a little bit.
>>
>> Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
>> ---
>>
>>  drivers/usb/host/xhci-pci.c | 16 ++--------------
>>  1 file changed, 2 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
>> index 5ad8452..56fd650 100644
>> --- a/drivers/usb/host/xhci-pci.c
>> +++ b/drivers/usb/host/xhci-pci.c
>> @@ -8,16 +8,10 @@
>>
>>  #include <common.h>
>>  #include <dm.h>
>> -#include <errno.h>
>>  #include <pci.h>
>>  #include <usb.h>
>> -
>>  #include "xhci.h"
>>
>> -struct xhci_pci_priv {
>> -     struct xhci_ctrl ctrl;  /* Needs to come first in this struct! */
>> -};
>> -
>>  static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr,
>>                         struct xhci_hcor **ret_hcor)
>>  {
>> @@ -55,13 +49,7 @@ static int xhci_pci_probe(struct udevice *dev)
>>
>>  static int xhci_pci_remove(struct udevice *dev)
>>  {
>> -     int ret;
>> -
>> -     ret = xhci_deregister(dev);
>> -     if (ret)
>> -             return ret;
>> -
>> -     return 0;
>> +     return xhci_deregister(dev);
>
> Can you insert xhci_deregister directly into the callbacks structure and
> nuke xhci_pci_remove() altogether ?

Either way:

Reviewed-by: Simon Glass <sjg at chromium.org>

>
>>  }
>>
>>  static const struct udevice_id xhci_pci_ids[] = {
>> @@ -77,7 +65,7 @@ U_BOOT_DRIVER(xhci_pci) = {
>>       .of_match = xhci_pci_ids,
>>       .ops    = &xhci_usb_ops,
>>       .platdata_auto_alloc_size = sizeof(struct usb_platdata),
>> -     .priv_auto_alloc_size = sizeof(struct xhci_pci_priv),
>> +     .priv_auto_alloc_size = sizeof(struct xhci_ctrl),
>>       .flags  = DM_FLAG_ALLOC_PRIV_DMA,
>>  };
>>
>>
>
>
> --
> Best regards,
> Marek Vasut


More information about the U-Boot mailing list