dm: Avoid accessing seq directly

At present various drivers etc. access the device's 'seq' member directly.
This makes it harder to change the meaning of that member. Change access
to go through a function instead.

The drivers/i2c/lpc32xx_i2c.c file is left unchanged for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/usb/host/ehci-mx5.c b/drivers/usb/host/ehci-mx5.c
index 0486263..0af02ba 100644
--- a/drivers/usb/host/ehci-mx5.c
+++ b/drivers/usb/host/ehci-mx5.c
@@ -321,7 +321,7 @@
 	mdelay(1);
 
 	priv->ehci = ehci;
-	priv->portnr = dev->seq;
+	priv->portnr = dev_seq(dev);
 	priv->init_type = type;
 
 	ret = device_get_supply_regulator(dev, "vbus-supply",
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 65ebd7c..a66ea49 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -596,7 +596,7 @@
 	}
 
 	priv->ehci = ehci;
-	priv->portnr = dev->seq;
+	priv->portnr = dev_seq(dev);
 	priv->init_type = type;
 
 #if CONFIG_IS_ENABLED(DM_REGULATOR)
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index cb50bf3..12c422d 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -383,7 +383,7 @@
 	struct ehci_hcor *hcor;
 
 	priv->ehci = dev_read_addr_ptr(dev);
-	priv->portnr = dev->seq;
+	priv->portnr = dev_seq(dev);
 	priv->init_type = plat->init_type;
 
 	hccr = (struct ehci_hccr *)&priv->ehci->hccapbase;
diff --git a/drivers/usb/host/ehci-vf.c b/drivers/usb/host/ehci-vf.c
index e0e4f84..79ee975 100644
--- a/drivers/usb/host/ehci-vf.c
+++ b/drivers/usb/host/ehci-vf.c
@@ -222,7 +222,7 @@
 	int node = dev_of_offset(dev);
 	const char *mode;
 
-	priv->portnr = dev->seq;
+	priv->portnr = dev_seq(dev);
 
 	priv->ehci = dev_read_addr_ptr(dev);
 	mode = fdt_getprop(dt_blob, node, "dr_mode", NULL);
diff --git a/drivers/usb/host/usb-sandbox.c b/drivers/usb/host/usb-sandbox.c
index e5442e7..d7cc92a 100644
--- a/drivers/usb/host/usb-sandbox.c
+++ b/drivers/usb/host/usb-sandbox.c
@@ -23,7 +23,7 @@
 	type = (pipe & USB_PIPE_TYPE_MASK) >> USB_PIPE_TYPE_SHIFT;
 	debug("0 0 S %c%c:%d:%03ld:%ld", types[type],
 	      pipe & USB_DIR_IN ? 'i' : 'o',
-	      bus->seq,
+	      dev_seq(bus),
 	      (pipe & USB_PIPE_DEV_MASK) >> USB_PIPE_DEV_SHIFT,
 	      (pipe & USB_PIPE_EP_MASK) >> USB_PIPE_EP_SHIFT);
 	if (setup) {
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index decee61..fee92c9 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -701,7 +701,7 @@
 			return ret;
 		ret = usb_find_and_bind_driver(parent, &udev->descriptor,
 					       iface,
-					       udev->controller_dev->seq,
+					       dev_seq(udev->controller_dev),
 					       udev->devnum, port, &dev);
 		if (ret)
 			return ret;