U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/9] dm: usb: Use usb_get_bus in dm ehci code
Date: Sun, 03 May 2015 19:15:36 +0200	[thread overview]
Message-ID: <554657B8.1060403@redhat.com> (raw)
In-Reply-To: <CAPnjgZ2D1Mnqe5hJzSWxJHAZ9YVbPA6bjWe379V6QxsaDv-bkw@mail.gmail.com>

Hi,

On 05/03/2015 06:59 PM, Simon Glass wrote:
> Hi Hans,
>
> On 1 May 2015 at 04:04, Hans de Goede <hdegoede@redhat.com> wrote:
>> Use usb_get_bus in dm ehci code rather then re-implementing it.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>   drivers/usb/host/ehci-hcd.c | 9 +--------
>>   1 file changed, 1 insertion(+), 8 deletions(-)
>>
>
> Acked-by: Simon Glass <sjg@chromium.org>
>
>> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
>> index bd9861d..85adbf4 100644
>> --- a/drivers/usb/host/ehci-hcd.c
>> +++ b/drivers/usb/host/ehci-hcd.c
>> @@ -125,14 +125,7 @@ static struct descriptor {
>>   static struct ehci_ctrl *ehci_get_ctrl(struct usb_device *udev)
>>   {
>>   #ifdef CONFIG_DM_USB
>> -       struct udevice *dev;
>> -
>> -       /* Find the USB controller */
>> -       for (dev = udev->dev;
>> -            device_get_uclass_id(dev) != UCLASS_USB;
>> -            dev = dev->parent)
>> -               ;
>> -       return dev_get_priv(dev);
>> +       return dev_get_priv(usb_get_bus(udev->dev));
>
> To be safe shouldn't we check for NULL here?

That should never happen, and there already is an assert for
that in usb_get_bus, or you mean dev_get_priv returning NULL.

Regards,

Hans



>
>>   #else
>>          return udev->controller;
>>   #endif
>> --
>> 2.3.6
>>
>
> Regards,
> Simon
>

  reply	other threads:[~2015-05-03 17:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-01 10:04 [U-Boot] [PATCH v2 0/9] usb: driver-model fixes and dm support sunxi-ehci.c Hans de Goede
2015-05-01 10:04 ` [U-Boot] [PATCH v2 1/9] dm: usb: Copy over usb_device values from usb_scan_device() to final usb_device Hans de Goede
2015-05-01 16:31   ` Simon Glass
2015-05-01 10:04 ` [U-Boot] [PATCH v2 2/9] dm: usb: Make usb_get_bus easier to use for callers Hans de Goede
2015-05-03 16:59   ` Simon Glass
2015-05-01 10:04 ` [U-Boot] [PATCH v2 3/9] dm: usb: Use usb_get_bus in dm ehci code Hans de Goede
2015-05-03 16:57   ` Simon Glass
2015-05-03 16:59   ` Simon Glass
2015-05-03 17:15     ` Hans de Goede [this message]
2015-05-03 17:20       ` Simon Glass
2015-05-01 10:04 ` [U-Boot] [PATCH v2 4/9] dm: usb: Fix finding of first upstream usb-2 hub in the ehci dm code Hans de Goede
2015-05-03 16:59   ` Simon Glass
2015-05-01 10:04 ` [U-Boot] [PATCH v2 5/9] dm: usb: Set desc_before_addr from " Hans de Goede
2015-05-01 10:04 ` [U-Boot] [PATCH v2 6/9] dm: usb: Add support for interrupt queues to the dm usb code Hans de Goede
2015-05-01 10:04 ` [U-Boot] [PATCH v2 7/9] dm: usb: Prefix ehci interrupt-queue functions with _ehci_ Hans de Goede
2015-05-01 10:04 ` [U-Boot] [PATCH v2 8/9] dm: usb: Add support for interrupt queues to the dm ehci code Hans de Goede
2015-05-01 10:04 ` [U-Boot] [PATCH v2 9/9] sunxi: ehci: Convert to the driver-model Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=554657B8.1060403@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox