From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Tue, 30 Jun 2015 14:29:54 +0200 Subject: [U-Boot] [PATCH 03/22] usb: usb_setup_device: Drop unneeded portnr function argument In-Reply-To: References: <1434569645-30322-1-git-send-email-hdegoede@redhat.com> <1434569645-30322-4-git-send-email-hdegoede@redhat.com> Message-ID: <55928BC2.2050506@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 29-06-15 05:44, Simon Glass wrote: > Hi Hans. > > On 17 June 2015 at 13:33, Hans de Goede wrote: >> Drop the unneeded portnr function argument, the portnr is part of the >> usb_device struct which is passed via the dev argument. >> >> Signed-off-by: Hans de Goede >> --- >> common/usb.c | 10 +++++----- >> drivers/usb/host/usb-uclass.c | 2 +- >> include/usb.h | 6 +++--- >> 3 files changed, 9 insertions(+), 9 deletions(-) > > This was needed in the case where a fake usb_device was passed in. Has > your previous refactoring changed that? The portnr is still passed but it is padded via the usb_device struct's portnr member. When doing a CONFIG_DM_USB=y build the only call site of usb_setup_device() is usb_scan_device() from drivers/usb/host/usb-uclass.c which does: udev->portnr = port; debug("Calling usb_setup_device(), portnr=%d\n", udev->portnr); parent_udev = device_get_uclass_id(parent) == UCLASS_USB_HUB ? dev_get_parentdata(parent) : NULL; ret = usb_setup_device(udev, priv->desc_before_addr, parent_udev); So portnr is always set in the usb_device strict, and that is what gets used after this patch. Regards, Hans