X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fusb%2Femul%2Fsandbox_hub.c;h=1432858fd594cd3b70ba7b4a4b0ddb9334fd3f35;hb=ccd7a4d2f42df7ebc8fd0fbbd31d5e6534cb590c;hp=baf8bdc857b6452315af9c7efec983dd2a1bc06d;hpb=093f2dce443296ab05b1b9a356a9153d5621791b;p=u-boot diff --git a/drivers/usb/emul/sandbox_hub.c b/drivers/usb/emul/sandbox_hub.c index baf8bdc857..1432858fd5 100644 --- a/drivers/usb/emul/sandbox_hub.c +++ b/drivers/usb/emul/sandbox_hub.c @@ -13,7 +13,7 @@ DECLARE_GLOBAL_DATA_PTR; /* We only support up to 8 */ -#define SANDBOX_NUM_PORTS 2 +#define SANDBOX_NUM_PORTS 4 struct sandbox_hub_platdata { struct usb_dev_platdata plat; @@ -96,7 +96,12 @@ static struct usb_hub_descriptor hub_desc = { 1 << 7), .bPwrOn2PwrGood = 2, .bHubContrCurrent = 5, - .DeviceRemovable = {0, 0xff}, /* all ports removeable */ + { + { + /* all ports removeable */ + .DeviceRemovable = {0, 0xff} + } + } #if SANDBOX_NUM_PORTS > 8 #error "This code sets up an incorrect mask" #endif @@ -156,7 +161,7 @@ static int clrset_post_state(struct udevice *hub, int port, int clear, int set) } else if (clear & USB_PORT_STAT_POWER) { debug("%s: %s: power off, removed, ret=%d\n", __func__, dev->name, ret); - ret = device_remove(dev); + ret = device_remove(dev, DM_REMOVE_NORMAL); clear |= USB_PORT_STAT_CONNECTION; } } @@ -277,7 +282,7 @@ static int sandbox_child_post_bind(struct udevice *dev) { struct sandbox_hub_platdata *plat = dev_get_parent_platdata(dev); - plat->port = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "reg", -1); + plat->port = dev_read_u32_default(dev, "reg", -1); return 0; }