summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-07-05 23:10:10 (GMT)
committerSimon Glass <sjg@chromium.org>2016-07-27 20:15:54 (GMT)
commit911954859d6dece49c3e4835faea004cfe392506 (patch)
tree79431b5419e1366009f331a3d1a604b64f14ccff /drivers/usb
parent2e3f1ff63f50f36e74d46f939823241856ebf1bd (diff)
downloadu-boot-911954859d6dece49c3e4835faea004cfe392506.tar.xz
dm: Use dm_scan_fdt_dev() directly where possible
Quite a few places have a bind() method which just calls dm_scan_fdt_dev(). We may as well call dm_scan_fdt_dev() directly. Update the code to do this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/emul/usb-emul-uclass.c8
-rw-r--r--drivers/usb/host/usb-uclass.c7
2 files changed, 2 insertions, 13 deletions
diff --git a/drivers/usb/emul/usb-emul-uclass.c b/drivers/usb/emul/usb-emul-uclass.c
index da91d04..6e03c1e 100644
--- a/drivers/usb/emul/usb-emul-uclass.c
+++ b/drivers/usb/emul/usb-emul-uclass.c
@@ -264,12 +264,6 @@ int usb_emul_setup_device(struct udevice *dev, int maxpacketsize,
return 0;
}
-int usb_emul_post_bind(struct udevice *dev)
-{
- /* Scan the bus for devices */
- return dm_scan_fdt_dev(dev);
-}
-
void usb_emul_reset(struct udevice *dev)
{
struct usb_dev_platdata *plat = dev_get_parent_platdata(dev);
@@ -281,7 +275,7 @@ void usb_emul_reset(struct udevice *dev)
UCLASS_DRIVER(usb_emul) = {
.id = UCLASS_USB_EMUL,
.name = "usb_emul",
- .post_bind = usb_emul_post_bind,
+ .post_bind = dm_scan_fdt_dev,
.per_child_auto_alloc_size = sizeof(struct usb_device),
.per_child_platdata_auto_alloc_size = sizeof(struct usb_dev_platdata),
};
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 070e271..be114fc 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -348,11 +348,6 @@ struct usb_device *usb_get_dev_index(struct udevice *bus, int index)
}
#endif
-int usb_post_bind(struct udevice *dev)
-{
- return dm_scan_fdt_dev(dev);
-}
-
int usb_setup_ehci_gadget(struct ehci_ctrl **ctlrp)
{
struct usb_platdata *plat;
@@ -766,7 +761,7 @@ UCLASS_DRIVER(usb) = {
.id = UCLASS_USB,
.name = "usb",
.flags = DM_UC_FLAG_SEQ_ALIAS,
- .post_bind = usb_post_bind,
+ .post_bind = dm_scan_fdt_dev,
.priv_auto_alloc_size = sizeof(struct usb_uclass_priv),
.per_child_auto_alloc_size = sizeof(struct usb_device),
.per_device_auto_alloc_size = sizeof(struct usb_bus_priv),