diff --git a/CHANGELOG b/CHANGELOG
index 449db66..bc33482 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,7 +2,9 @@
 Changes since U-Boot 1.1.4:
 ======================================================================
 
-* Various USB related patches 
+* Code cleanup
+
+* Various USB related patches
   - Add support for mpc8xx USB device.
   - Add support for Common Device Class - Abstract Control Model USB console.
   - Add support for flow control in USB slave devices.
diff --git a/README b/README
index 284a688..178e51e 100644
--- a/README
+++ b/README
@@ -870,7 +870,7 @@
 		attach your usb cable. The Unix command "dmesg" should print
 		it has found a new device. The environment variable usbtty
 		can be set to gserial or cdc_acm to enable your device to
-		appear to a USB host as a Linux gserial device or a 
+		appear to a USB host as a Linux gserial device or a
 		Common Device Class Abstract Control Model serial device.
 		If you select usbtty = gserial you should be able to enumerate
 		a Linux host by
@@ -878,14 +878,14 @@
 		else if using cdc_acm, simply setting the environment
 		variable usbtty to be cdc_acm should suffice. The following
 		might be defined in YourBoardName.h
-	
+
 			CONFIG_USB_DEVICE
 			Define this to build a UDC device
 
 			CONFIG_USB_TTY
 			Define this to have a tty type of device available to
 			talk to the UDC device
-		
+
 			CFG_CONSOLE_IS_IN_ENV
 			Define this if you want stdin, stdout &/or stderr to
 			be set to usbtty.
@@ -893,15 +893,15 @@
 			mpc8xx:
 				CFG_USB_EXTC_CLK 0xBLAH
 				Derive USB clock from external clock "blah"
-				- CFG_USB_EXTC_CLK 0x02	
-				
+				- CFG_USB_EXTC_CLK 0x02
+
 				CFG_USB_BRG_CLK 0xBLAH
 				Derive USB clock from brgclk
 				- CFG_USB_BRG_CLK 0x04
 
-		If you have a USB-IF assigned VendorID then you may wish to 
+		If you have a USB-IF assigned VendorID then you may wish to
 		define your own vendor specific values either in BoardName.h
-		or directly in usbd_vendor_info.h. If you don't define 
+		or directly in usbd_vendor_info.h. If you don't define
 		CONFIG_USBD_MANUFACTURER, CONFIG_USBD_PRODUCT_NAME,
 		CONFIG_USBD_VENDORID and CONFIG_USBD_PRODUCTID, then U-Boot
 		should pretend to be a Linux device to it's target host.
@@ -909,7 +909,7 @@
 			CONFIG_USBD_MANUFACTURER
 			Define this string as the name of your company for
 			- CONFIG_USBD_MANUFACTURER "my company"
-			
+
 			CONFIG_USBD_PRODUCT_NAME
 			Define this string as the name of your product
 			- CONFIG_USBD_PRODUCT_NAME "acme usb device"
@@ -919,13 +919,13 @@
 			Implementors Forum. This *must* be a genuine Vendor ID
 			to avoid polluting the USB namespace.
 			- CONFIG_USBD_VENDORID 0xFFFF
-				 
+
 			CONFIG_USBD_PRODUCTID
 			Define this as the unique Product ID
 			for your device
 			- CONFIG_USBD_PRODUCTID 0xFFFF
-		
-			
+
+
 - MMC Support:
 		The MMC controller on the Intel PXA is supported. To
 		enable this define CONFIG_MMC. The MMC can be
diff --git a/drivers/usbdcore_ep0.c b/drivers/usbdcore_ep0.c
index 5e7443b..1e44f32 100644
--- a/drivers/usbdcore_ep0.c
+++ b/drivers/usbdcore_ep0.c
@@ -44,7 +44,7 @@
  * XXX
  *
  * As alluded to above, a simple callback cdc_recv_setup has been implemented
- * in the usb_device data structure to facilicate passing 
+ * in the usb_device data structure to facilicate passing
  * Common Device Class packets to a function driver.
  *
  * XXX
@@ -221,7 +221,7 @@
 				(struct usb_device_descriptor *) urb->buffer;
 
 		}
-		dbg_ep0(3, "copied device configuration, actual_length: 0x%x", urb->actual_length); 
+		dbg_ep0(3, "copied device configuration, actual_length: 0x%x", urb->actual_length);
 		break;
 
 	case USB_DESCRIPTOR_TYPE_CONFIGURATION:
@@ -268,7 +268,7 @@
 				serial_printf("Invalid string index %d\n", index);
 				return -1;
 			}
-			dbg_ep0(3, "string_descriptor: %p length %d", string_descriptor, string_descriptor->bLength); 
+			dbg_ep0(3, "string_descriptor: %p length %d", string_descriptor, string_descriptor->bLength);
 			copy_config (urb, string_descriptor, string_descriptor->bLength, max);
 		}
 		break;
@@ -344,7 +344,7 @@
 	case USB_DESCRIPTOR_TYPE_DEVICE_QUALIFIER:
 		{
 			/* If a USB device supports both a full speed and low speed operation
-			 * we must send a Device_Qualifier descriptor here 
+			 * we must send a Device_Qualifier descriptor here
 			 */
 			return -1;
 		}
diff --git a/drivers/usbdcore_mpc8xx.c b/drivers/usbdcore_mpc8xx.c
index 9bd2c23..e87284b 100644
--- a/drivers/usbdcore_mpc8xx.c
+++ b/drivers/usbdcore_mpc8xx.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2006 by Bryan O'Donoghue, CodeHermit
- * bodonoghue@CodeHermit.ie                                             
+ * bodonoghue@CodeHermit.ie
  *
  * References
  * DasUBoot/drivers/usbdcore_omap1510.c, for design and implementation ideas.
@@ -12,7 +12,7 @@
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
@@ -24,12 +24,12 @@
 
 /*
  * Notes :
- * 1.	#define __SIMULATE_ERROR__ to inject a CRC error into every 2nd TX 
+ * 1.	#define __SIMULATE_ERROR__ to inject a CRC error into every 2nd TX
  *		packet to force the USB re-transmit protocol.
  *
  * 2.	#define __DEBUG_UDC__ to switch on debug tracing to serial console
- * 	be careful that tracing doesn't create Hiesen-bugs with respect to
- * 	response timeouts to control requests.
+ *	be careful that tracing doesn't create Hiesen-bugs with respect to
+ *	response timeouts to control requests.
  *
  * 3.	This driver should be able to support any higher level driver that
  *	that wants to do either of the two standard UDC implementations
@@ -41,18 +41,18 @@
  *
  * 5.	For some reason, cbd_datlen is *always* +2 the value it should be.
  *	this means that having an RX cbd of 16 bytes is not possible, since
- * 	the same size is reported for 14 bytes received as 16 bytes received
+ *	the same size is reported for 14 bytes received as 16 bytes received
  *	until we can find out why this happens, RX cbds must be limited to 8
  *	bytes. TODO: check errata for this behaviour.
  *
  * 6.	Right now this code doesn't support properly powering up with the USB
- * 	cable attached to the USB host my development board the Adder87x doesn't
- * 	have a pull-up fitted to allow this, so it is necessary to power the
- * 	board and *then* attached the USB cable to the host. However somebody
- * 	with a different design in their board may be able to keep the cable
- * 	constantly connected and simply enable/disable a pull-up  re
- * 	figure 31.1 in MPC885RM.pdf instead of having to power up the board and
- * 	then attach the cable !
+ *	cable attached to the USB host my development board the Adder87x doesn't
+ *	have a pull-up fitted to allow this, so it is necessary to power the
+ *	board and *then* attached the USB cable to the host. However somebody
+ *	with a different design in their board may be able to keep the cable
+ *	constantly connected and simply enable/disable a pull-up  re
+ *	figure 31.1 in MPC885RM.pdf instead of having to power up the board and
+ *	then attach the cable !
  *
  */
 #include <common.h>
@@ -60,7 +60,7 @@
 
 #if defined(CONFIG_MPC885_FAMILY) && defined(CONFIG_USB_DEVICE)
 #include <commproc.h>
-#include "usbdcore.h"	
+#include "usbdcore.h"
 #include "usbdcore_mpc8xx.h"
 #include "usbdcore_ep0.h"
 
@@ -68,24 +68,24 @@
 	serial_printf("ERROR : [%s] %s:%d: "fmt,\
 				__FILE__,__FUNCTION__,__LINE__, ##args)
 #ifdef __DEBUG_UDC__
-	#define DBG(fmt,args...)\
+#define DBG(fmt,args...)\
 		serial_printf("[%s] %s:%d: "fmt,\
 				__FILE__,__FUNCTION__,__LINE__, ##args)
 #else
-	#define DBG(fmt,args...)
+#define DBG(fmt,args...)
 #endif
 
 /* Static Data */
 #ifdef __SIMULATE_ERROR__
-	static char err_poison_test = 0;
+static char err_poison_test = 0;
 #endif
 static struct mpc8xx_ep ep_ref[MAX_ENDPOINTS];
 static u32 address_base = STATE_NOT_READY;
 static mpc8xx_udc_state_t udc_state = 0;
 static struct usb_device_instance *udc_device = 0;
-static volatile usb_epb_t *endpoints[MAX_ENDPOINTS];		
-static volatile cbd_t * tx_cbd[TX_RING_SIZE];
-static volatile cbd_t * rx_cbd[RX_RING_SIZE];
+static volatile usb_epb_t *endpoints[MAX_ENDPOINTS];
+static volatile cbd_t *tx_cbd[TX_RING_SIZE];
+static volatile cbd_t *rx_cbd[RX_RING_SIZE];
 static volatile immap_t *immr = 0;
 static volatile cpm8xx_t *cp = 0;
 static volatile usb_pram_t *usb_paramp = 0;
@@ -95,87 +95,87 @@
 
 /* Static Function Declarations */
 static void mpc8xx_udc_state_transition_up (usb_device_state_t initial,
-                                            usb_device_state_t final);    
+					    usb_device_state_t final);
 static void mpc8xx_udc_state_transition_down (usb_device_state_t initial,
-                                              usb_device_state_t final);
+					      usb_device_state_t final);
 static void mpc8xx_udc_stall (unsigned int ep);
-static void mpc8xx_udc_flush_tx_fifo(int epid);
-static void mpc8xx_udc_flush_rx_fifo(void);
+static void mpc8xx_udc_flush_tx_fifo (int epid);
+static void mpc8xx_udc_flush_rx_fifo (void);
 static void mpc8xx_udc_clear_rxbd (volatile cbd_t * rx_cbdp);
-static void mpc8xx_udc_init_tx(struct usb_endpoint_instance *epi, 
-		struct urb * tx_urb);
-static void mpc8xx_udc_dump_request(struct usb_device_request *request);
-static void mpc8xx_udc_clock_init (volatile immap_t * immr, 
-		volatile cpm8xx_t * cp);
+static void mpc8xx_udc_init_tx (struct usb_endpoint_instance *epi,
+				struct urb *tx_urb);
+static void mpc8xx_udc_dump_request (struct usb_device_request *request);
+static void mpc8xx_udc_clock_init (volatile immap_t * immr,
+				   volatile cpm8xx_t * cp);
 static int mpc8xx_udc_ep_tx (struct usb_endpoint_instance *epi);
 static int mpc8xx_udc_epn_rx (unsigned int epid, volatile cbd_t * rx_cbdp);
-static void mpc8xx_udc_ep0_rx(volatile cbd_t * rx_cbdp);
+static void mpc8xx_udc_ep0_rx (volatile cbd_t * rx_cbdp);
 static void mpc8xx_udc_cbd_init (void);
 static void mpc8xx_udc_endpoint_init (void);
 static void mpc8xx_udc_cbd_attach (int ep, uchar tx_size, uchar rx_size);
 static u32 mpc8xx_udc_alloc (u32 data_size, u32 alignment);
 static int mpc8xx_udc_ep0_rx_setup (volatile cbd_t * rx_cbdp);
 static void mpc8xx_udc_set_nak (unsigned int ep);
-static short mpc8xx_udc_handle_txerr(void);
-static void mpc8xx_udc_advance_rx(volatile cbd_t ** rx_cbdp, int epid);
+static short mpc8xx_udc_handle_txerr (void);
+static void mpc8xx_udc_advance_rx (volatile cbd_t ** rx_cbdp, int epid);
 
 /******************************************************************************
-                               Global Linkage
+			       Global Linkage
  *****************************************************************************/
 
 /* udc_init
  *
  * Do initial bus gluing
  */
-int udc_init(void)
+int udc_init (void)
 {
 	/* Init various pointers */
 	immr = (immap_t *) CFG_IMMR;
-	cp = (cpm8xx_t *)&(immr->im_cpm);
-	usb_paramp = (usb_pram_t*)&(cp->cp_dparam[PROFF_USB]);
-	usbp = (usb_t *) &(cp->cp_scc[0]);
+	cp = (cpm8xx_t *) & (immr->im_cpm);
+	usb_paramp = (usb_pram_t *) & (cp->cp_dparam[PROFF_USB]);
+	usbp = (usb_t *) & (cp->cp_scc[0]);
 
-	memset(ep_ref, 0x00, (sizeof(struct mpc8xx_ep) * MAX_ENDPOINTS));
-	
+	memset (ep_ref, 0x00, (sizeof (struct mpc8xx_ep) * MAX_ENDPOINTS));
+
 	udc_device = 0;
 	udc_state = STATE_NOT_READY;
-	
-	usbp->usmod= 0x00;
-	usbp->uscom= 0;
-		
+
+	usbp->usmod = 0x00;
+	usbp->uscom = 0;
+
 	/* Set USB Frame #0, Respond at Address & Get a clock source  */
 	usbp->usaddr = 0x00;
 	mpc8xx_udc_clock_init (immr, cp);
-	
+
 	/* PA15, PA14 as perhiperal USBRXD and USBOE */
-	immr->im_ioport.iop_padir&= ~0x0003;
-	immr->im_ioport.iop_papar|= 0x0003;
-				
+	immr->im_ioport.iop_padir &= ~0x0003;
+	immr->im_ioport.iop_papar |= 0x0003;
+
 	/* PC11/PC10 as peripheral USBRXP USBRXN */
-	immr->im_ioport.iop_pcso|= 0x0030;
-	
+	immr->im_ioport.iop_pcso |= 0x0030;
+
 	/* PC7/PC6 as perhiperal USBTXP and USBTXN */
-	immr->im_ioport.iop_pcdir|= 0x0300;
-	immr->im_ioport.iop_pcpar|= 0x0300;
-	
+	immr->im_ioport.iop_pcdir |= 0x0300;
+	immr->im_ioport.iop_pcpar |= 0x0300;
+
 	/* Set the base address */
-	address_base = (u32)(cp->cp_dpmem + CPM_USB_BASE);
+	address_base = (u32) (cp->cp_dpmem + CPM_USB_BASE);
 
 	/* Initialise endpoints and circular buffers */
-	mpc8xx_udc_endpoint_init();	
-	mpc8xx_udc_cbd_init();		
-		
+	mpc8xx_udc_endpoint_init ();
+	mpc8xx_udc_cbd_init ();
+
 	/* Assign allocated Dual Port Endpoint descriptors */
-	usb_paramp->ep0ptr = (u32)endpoints[0];
-	usb_paramp->ep1ptr = (u32)endpoints[1];
-	usb_paramp->ep2ptr = (u32)endpoints[2];
-	usb_paramp->ep3ptr = (u32)endpoints[3];
+	usb_paramp->ep0ptr = (u32) endpoints[0];
+	usb_paramp->ep1ptr = (u32) endpoints[1];
+	usb_paramp->ep2ptr = (u32) endpoints[2];
+	usb_paramp->ep3ptr = (u32) endpoints[3];
 	usb_paramp->frame_n = 0;
 
-	DBG("ep0ptr=0x%08x ep1ptr=0x%08x ep2ptr=0x%08x ep3ptr=0x%08x\n",
-		usb_paramp->ep0ptr, usb_paramp->ep1ptr, usb_paramp->ep2ptr,
-		usb_paramp->ep3ptr);
-	
+	DBG ("ep0ptr=0x%08x ep1ptr=0x%08x ep2ptr=0x%08x ep3ptr=0x%08x\n",
+	     usb_paramp->ep0ptr, usb_paramp->ep1ptr, usb_paramp->ep2ptr,
+	     usb_paramp->ep3ptr);
+
 	return 0;
 }
 
@@ -183,149 +183,147 @@
  *
  * Poll for whatever events may have occured
  */
-void udc_irq(void)
+void udc_irq (void)
 {
 	int epid = 0;
-	volatile cbd_t * rx_cbdp = 0;
-	volatile cbd_t * rx_cbdp_base = 0;
+	volatile cbd_t *rx_cbdp = 0;
+	volatile cbd_t *rx_cbdp_base = 0;
 
-	if(udc_state!=STATE_READY){
+	if (udc_state != STATE_READY) {
 		return;
 	}
-	
-	if(usbp->usber&USB_E_BSY){
+
+	if (usbp->usber & USB_E_BSY) {
 		/* This shouldn't happen. If it does then it's a bug ! */
-		usbp->usber|=USB_E_BSY;	
-		mpc8xx_udc_flush_rx_fifo();
+		usbp->usber |= USB_E_BSY;
+		mpc8xx_udc_flush_rx_fifo ();
 	}
 
-	
 	/* Scan all RX/Bidirectional Endpoints for RX data. */
-	for(epid = 0; epid<MAX_ENDPOINTS; epid++){
-				
-		if(!ep_ref[epid].prx){
+	for (epid = 0; epid < MAX_ENDPOINTS; epid++) {
+		if (!ep_ref[epid].prx) {
 			continue;
 		}
-
 		rx_cbdp = rx_cbdp_base = ep_ref[epid].prx;
-		do{
-			if(!(rx_cbdp->cbd_sc&RX_BD_E)){
-				
-				if(rx_cbdp->cbd_sc&0x1F){
+
+		do {
+			if (!(rx_cbdp->cbd_sc & RX_BD_E)) {
+
+				if (rx_cbdp->cbd_sc & 0x1F) {
 					/* Corrupt data discard it.
-					 * Controller has NAK'd this packet. 
+					 * Controller has NAK'd this packet.
 					 */
-					mpc8xx_udc_clear_rxbd(rx_cbdp);
+					mpc8xx_udc_clear_rxbd (rx_cbdp);
 
-				}else{
-					if(!epid){
-						mpc8xx_udc_ep0_rx(rx_cbdp);
+				} else {
+					if (!epid) {
+						mpc8xx_udc_ep0_rx (rx_cbdp);
 
-					}else{
+					} else {
 						/* Process data */
-						mpc8xx_udc_set_nak(epid);
-						mpc8xx_udc_epn_rx(epid,rx_cbdp);
-						mpc8xx_udc_clear_rxbd(rx_cbdp);
-					}	
+						mpc8xx_udc_set_nak (epid);
+						mpc8xx_udc_epn_rx (epid, rx_cbdp);
+						mpc8xx_udc_clear_rxbd (rx_cbdp);
+					}
 				}
-				
+
 				/* Advance RX CBD pointer */
-				mpc8xx_udc_advance_rx(&rx_cbdp, epid);
+				mpc8xx_udc_advance_rx (&rx_cbdp, epid);
 				ep_ref[epid].prx = rx_cbdp;
-			}else{
+			} else {
 				/* Advance RX CBD pointer */
-				mpc8xx_udc_advance_rx(&rx_cbdp, epid);
+				mpc8xx_udc_advance_rx (&rx_cbdp, epid);
 			}
 
-		}while(rx_cbdp != rx_cbdp_base);
+		} while (rx_cbdp != rx_cbdp_base);
 	}
 
 	/* Handle TX events as appropiate, the correct place to do this is
 	 * in a tx routine. Perhaps TX on epn was pre-empted by ep0
 	 */
 
-	if(usbp->usber&USB_E_TXB){
-		usbp->usber|=USB_E_TXB;
+	if (usbp->usber & USB_E_TXB) {
+		usbp->usber |= USB_E_TXB;
 	}
-	
-	if(usbp->usber&(USB_TX_ERRMASK)){
-		mpc8xx_udc_handle_txerr();
+
+	if (usbp->usber & (USB_TX_ERRMASK)) {
+		mpc8xx_udc_handle_txerr ();
 	}
 
 	/* Switch to the default state, respond at the default address */
-	if(usbp->usber&USB_E_RESET){
-		usbp->usber|=USB_E_RESET;
-		usbp->usaddr = 0x00;	
+	if (usbp->usber & USB_E_RESET) {
+		usbp->usber |= USB_E_RESET;
+		usbp->usaddr = 0x00;
 		udc_device->device_state = STATE_DEFAULT;
 	}
 
-	/*if(usbp->usber&USB_E_IDLE){
-		We could suspend here !
-		usbp->usber|=USB_E_IDLE;
-		DBG("idle state change\n");		
-	}			
-	if(usbp->usbs){
-		We could resume here when IDLE is deasserted !
-		Not worth doing, so long as we are self powered though.
-	}*/
+	/* if(usbp->usber&USB_E_IDLE){
+	   We could suspend here !
+	   usbp->usber|=USB_E_IDLE;
+	   DBG("idle state change\n");
+	   }
+	   if(usbp->usbs){
+	   We could resume here when IDLE is deasserted !
+	   Not worth doing, so long as we are self powered though.
+	   }
+	*/
 
 	return;
 }
 
-
-
 /* udc_endpoint_write
  *
  * Write some data to an endpoint
  */
-int udc_endpoint_write(struct usb_endpoint_instance *epi)
+int udc_endpoint_write (struct usb_endpoint_instance *epi)
 {
 	int ep = 0;
 	short epid = 1, unnak = 0, ret = 0;
 
-	if(udc_state != STATE_READY){
-		ERR("invalid udc_state != STATE_READY!\n");
+	if (udc_state != STATE_READY) {
+		ERR ("invalid udc_state != STATE_READY!\n");
 		return -1;
 	}
 
-	if(!udc_device || !epi){
+	if (!udc_device || !epi) {
 		return -1;
 	}
-	
-	if(udc_device->device_state!=STATE_CONFIGURED){
+
+	if (udc_device->device_state != STATE_CONFIGURED) {
 		return -1;
 	}
 
 	ep = epi->endpoint_address & 0x03;
-	if(ep >= MAX_ENDPOINTS){
+	if (ep >= MAX_ENDPOINTS) {
 		return -1;
 	}
-	
+
 	/* Set NAK for all RX endpoints during TX */
-	for(epid = 1; epid<MAX_ENDPOINTS; epid++){
+	for (epid = 1; epid < MAX_ENDPOINTS; epid++) {
 
 		/* Don't set NAK on DATA IN/CONTROL endpoints */
-		if(ep_ref[epid].sc & USB_DIR_IN){
+		if (ep_ref[epid].sc & USB_DIR_IN) {
 			continue;
 		}
 
-		if(!(usbp->usep[epid]&( USEP_THS_NAK | USEP_RHS_NAK ))){
-			unnak |= 1<<epid;
+		if (!(usbp->usep[epid] & (USEP_THS_NAK | USEP_RHS_NAK))) {
+			unnak |= 1 << epid;
 		}
 
-		mpc8xx_udc_set_nak(epid);
+		mpc8xx_udc_set_nak (epid);
 	}
 
-	mpc8xx_udc_init_tx(&udc_device->bus->endpoint_array[ep],epi->tx_urb);
-	ret = mpc8xx_udc_ep_tx(&udc_device->bus->endpoint_array[ep]);
-	
+	mpc8xx_udc_init_tx (&udc_device->bus->endpoint_array[ep],
+			    epi->tx_urb);
+	ret = mpc8xx_udc_ep_tx (&udc_device->bus->endpoint_array[ep]);
+
 	/* Remove temporary NAK */
-	for(epid = 1; epid<MAX_ENDPOINTS; epid++){
-		if(unnak&(1<<epid)){
-			udc_unset_nak(epid);
+	for (epid = 1; epid < MAX_ENDPOINTS; epid++) {
+		if (unnak & (1 << epid)) {
+			udc_unset_nak (epid);
 		}
 	}
-	
+
 	return ret;
 }
 
@@ -333,41 +331,40 @@
  *
  * Associate a given urb to an endpoint TX or RX transmit/receive buffers
  */
-static int mpc8xx_udc_assign_urb(int ep, char direction)
+static int mpc8xx_udc_assign_urb (int ep, char direction)
 {
 	struct usb_endpoint_instance *epi = 0;
-	
-	if(ep >= MAX_ENDPOINTS){
+
+	if (ep >= MAX_ENDPOINTS) {
 		goto err;
 	}
 	epi = &udc_device->bus->endpoint_array[ep];
-	if(!epi){
+	if (!epi) {
 		goto err;
 	}
 
-	if(!ep_ref[ep].urb){
-		ep_ref[ep].urb = usbd_alloc_urb(udc_device, 
-			udc_device->bus->endpoint_array);
-		if(!ep_ref[ep].urb){
+	if (!ep_ref[ep].urb) {
+		ep_ref[ep].urb = usbd_alloc_urb (udc_device, udc_device->bus->endpoint_array);
+		if (!ep_ref[ep].urb) {
 			goto err;
 		}
-	}else{
+	} else {
 		ep_ref[ep].urb->actual_length = 0;
 	}
 
-	switch(direction){
-		case USB_DIR_IN:
-			epi->tx_urb = ep_ref[ep].urb;
-			break;
-		case USB_DIR_OUT:
-			epi->rcv_urb = ep_ref[ep].urb;
-			break;
-		default:
-			goto err;
+	switch (direction) {
+	case USB_DIR_IN:
+		epi->tx_urb = ep_ref[ep].urb;
+		break;
+	case USB_DIR_OUT:
+		epi->rcv_urb = ep_ref[ep].urb;
+		break;
+	default:
+		goto err;
 	}
 	return 0;
 
-err:
+      err:
 	udc_state = STATE_ERROR;
 	return -1;
 }
@@ -377,83 +374,84 @@
  * Associate U-Boot software endpoints to mpc8xx endpoint parameter ram
  * Isochronous endpoints aren't yet supported!
  */
-void udc_setup_ep(struct usb_device_instance *device, unsigned int ep,
-                  struct usb_endpoint_instance *epi)
+void udc_setup_ep (struct usb_device_instance *device, unsigned int ep,
+		   struct usb_endpoint_instance *epi)
 {
 	uchar direction = 0;
 	int ep_attrib = 0;
 
-	if(epi && (ep < MAX_ENDPOINTS)){
-		
-		if(ep == 0){
-			if (epi->rcv_attributes!=USB_ENDPOINT_XFER_CONTROL 
-				||epi->tx_attributes!= 
-				USB_ENDPOINT_XFER_CONTROL){
+	if (epi && (ep < MAX_ENDPOINTS)) {
 
-				/* ep0 must be a control endpoint*/
+		if (ep == 0) {
+			if (epi->rcv_attributes != USB_ENDPOINT_XFER_CONTROL
+			    || epi->tx_attributes !=
+			    USB_ENDPOINT_XFER_CONTROL) {
+
+				/* ep0 must be a control endpoint */
 				udc_state = STATE_ERROR;
 				return;
 
 			}
-			if(!(ep_ref[ep].sc & EP_ATTACHED)){
-				mpc8xx_udc_cbd_attach (ep, epi->tx_packetSize, 
-					epi->rcv_packetSize);
+			if (!(ep_ref[ep].sc & EP_ATTACHED)) {
+				mpc8xx_udc_cbd_attach (ep, epi->tx_packetSize,
+						       epi->rcv_packetSize);
 			}
 			usbp->usep[ep] = 0x0000;
 			return;
 		}
-		
-		if ((epi->endpoint_address & USB_ENDPOINT_DIR_MASK) 
-			== USB_DIR_IN) {
+
+		if ((epi->endpoint_address & USB_ENDPOINT_DIR_MASK)
+		    == USB_DIR_IN) {
 
 			direction = 1;
 			ep_attrib = epi->tx_attributes;
 			epi->rcv_packetSize = 0;
-			ep_ref[ep].sc |= USB_DIR_IN;		
+			ep_ref[ep].sc |= USB_DIR_IN;
 		} else {
-			
+
 			direction = 0;
 			ep_attrib = epi->rcv_attributes;
-			epi->tx_packetSize = 0;	
+			epi->tx_packetSize = 0;
 			ep_ref[ep].sc &= ~USB_DIR_IN;
 		}
 
-		if(mpc8xx_udc_assign_urb(ep, epi->endpoint_address
-					&USB_ENDPOINT_DIR_MASK)){
+		if (mpc8xx_udc_assign_urb (ep, epi->endpoint_address
+					   & USB_ENDPOINT_DIR_MASK)) {
 			return;
 		}
 
-		switch(ep_attrib){
-			case USB_ENDPOINT_XFER_CONTROL:
-				if(!(ep_ref[ep].sc & EP_ATTACHED)){
-					mpc8xx_udc_cbd_attach (ep,
-						epi->tx_packetSize, 
-						epi->rcv_packetSize);
-				}
-				usbp->usep[ep] = ep<<12;
-				epi->rcv_urb = epi->tx_urb = ep_ref[ep].urb;
+		switch (ep_attrib) {
+		case USB_ENDPOINT_XFER_CONTROL:
+			if (!(ep_ref[ep].sc & EP_ATTACHED)) {
+				mpc8xx_udc_cbd_attach (ep,
+						       epi->tx_packetSize,
+						       epi->rcv_packetSize);
+			}
+			usbp->usep[ep] = ep << 12;
+			epi->rcv_urb = epi->tx_urb = ep_ref[ep].urb;
 
-				break;
-			case USB_ENDPOINT_XFER_BULK :
-			case USB_ENDPOINT_XFER_INT:
-				if(!(ep_ref[ep].sc & EP_ATTACHED)){
-					if(direction){
-						mpc8xx_udc_cbd_attach (ep, 
-							epi->tx_packetSize, 0);
-					}else{
-						mpc8xx_udc_cbd_attach (ep, 
-							0, epi->rcv_packetSize);
-					}
+			break;
+		case USB_ENDPOINT_XFER_BULK:
+		case USB_ENDPOINT_XFER_INT:
+			if (!(ep_ref[ep].sc & EP_ATTACHED)) {
+				if (direction) {
+					mpc8xx_udc_cbd_attach (ep,
+							       epi->tx_packetSize,
+							       0);
+				} else {
+					mpc8xx_udc_cbd_attach (ep,
+							       0,
+							       epi->rcv_packetSize);
 				}
-				usbp->usep[ep]=	(ep<<12)|((ep_attrib)<<8);
-					
-				break;
-			case USB_ENDPOINT_XFER_ISOC:
-			default:
-				serial_printf("Error endpoint attrib %d>3\n",
-						ep_attrib);
-				udc_state = STATE_ERROR;
-				break;
+			}
+			usbp->usep[ep] = (ep << 12) | ((ep_attrib) << 8);
+
+			break;
+		case USB_ENDPOINT_XFER_ISOC:
+		default:
+			serial_printf ("Error endpoint attrib %d>3\n", ep_attrib);
+			udc_state = STATE_ERROR;
+			break;
 		}
 	}
 
@@ -463,54 +461,53 @@
  *
  * Move state, switch on the USB
  */
-void udc_connect(void)
+void udc_connect (void)
 {
-	/* Enable pull-up resistor on D+ 
+	/* Enable pull-up resistor on D+
 	 * TODO: fit a pull-up resistor to drive SE0 for > 2.5us
 	 */
-	
-	if(udc_state!=STATE_ERROR){
+
+	if (udc_state != STATE_ERROR) {
 		udc_state = STATE_READY;
-		usbp->usmod|= USMOD_EN;
+		usbp->usmod |= USMOD_EN;
 	}
-}	
+}
 
 /* udc_disconnect
  *
  * Disconnect is not used but, is included for completeness
  */
-void udc_disconnect(void)
+void udc_disconnect (void)
 {
 	/* Disable pull-up resistor on D-
 	 * TODO: fix a pullup resistor to control this
 	 */
 
-	if(udc_state!=STATE_ERROR){
+	if (udc_state != STATE_ERROR) {
 		udc_state = STATE_NOT_READY;
 	}
-	usbp->usmod&=~USMOD_EN;
+	usbp->usmod &= ~USMOD_EN;
 }
 
 /* udc_enable
- * 
+ *
  * Grab an EP0 URB, register interest in a subset of USB events
  */
-void udc_enable(struct usb_device_instance *device)
+void udc_enable (struct usb_device_instance *device)
 {
-	if(udc_state == STATE_ERROR){
+	if (udc_state == STATE_ERROR) {
 		return;
 	}
 
 	udc_device = device;
-	
-	if(!ep_ref[0].urb){
-		ep_ref[0].urb = usbd_alloc_urb(device, 
-					device->bus->endpoint_array);
+
+	if (!ep_ref[0].urb) {
+		ep_ref[0].urb = usbd_alloc_urb (device, device->bus->endpoint_array);
 	}
 
 	/* Register interest in all events except SOF, enable transceiver */
-	usbp->usber= 0x03FF;
-	usbp->usbmr= 0x02F7;
+	usbp->usber = 0x03FF;
+	usbp->usbmr = 0x02F7;
 
 	return;
 }
@@ -519,26 +516,26 @@
  *
  * disable the currently hooked device
  */
-void udc_disable(void)
+void udc_disable (void)
 {
 	int i = 0;
 
-	if(udc_state == STATE_ERROR){
-		DBG("Won't disable UDC. udc_state==STATE_ERROR !\n");
+	if (udc_state == STATE_ERROR) {
+		DBG ("Won't disable UDC. udc_state==STATE_ERROR !\n");
 		return;
 	}
 
 	udc_device = 0;
 
-	for(;i<MAX_ENDPOINTS; i++){
-		if(ep_ref[i].urb){
-			usbd_dealloc_urb(ep_ref[i].urb);
+	for (; i < MAX_ENDPOINTS; i++) {
+		if (ep_ref[i].urb) {
+			usbd_dealloc_urb (ep_ref[i].urb);
 			ep_ref[i].urb = 0;
 		}
 	}
-		
-	usbp->usbmr= 0x00;	
-	usbp->usmod= ~USMOD_EN;
+
+	usbp->usbmr = 0x00;
+	usbp->usmod = ~USMOD_EN;
 	udc_state = STATE_NOT_READY;
 }
 
@@ -546,46 +543,46 @@
  *
  * Enable the specified device
  */
-void udc_startup_events(struct usb_device_instance *device)
+void udc_startup_events (struct usb_device_instance *device)
 {
-	udc_enable(device);
-	if(udc_state == STATE_READY){
+	udc_enable (device);
+	if (udc_state == STATE_READY) {
 		usbd_device_event_irq (device, DEVICE_CREATE, 0);
 	}
 }
 
 /* udc_set_nak
- * 
+ *
  * Allow upper layers to signal lower layers should not accept more RX data
  *
  */
-void udc_set_nak(int epid)
+void udc_set_nak (int epid)
 {
-	if(epid){
-		mpc8xx_udc_set_nak(epid);
+	if (epid) {
+		mpc8xx_udc_set_nak (epid);
 	}
 }
 
-/* udc_unset_nak 
- * 
+/* udc_unset_nak
+ *
  * Suspend sending of NAK tokens for DATA OUT tokens on a given endpoint.
  * Switch off NAKing on this endpoint to accept more data output from host.
  *
  */
 void udc_unset_nak (int epid)
 {
-	if(epid > MAX_ENDPOINTS){
+	if (epid > MAX_ENDPOINTS) {
 		return;
 	}
 
-	if(usbp->usep[epid]&(USEP_THS_NAK | USEP_RHS_NAK)){
-		usbp->usep[epid]&= ~(USEP_THS_NAK | USEP_RHS_NAK);
+	if (usbp->usep[epid] & (USEP_THS_NAK | USEP_RHS_NAK)) {
+		usbp->usep[epid] &= ~(USEP_THS_NAK | USEP_RHS_NAK);
 		__asm__ ("eieio");
 	}
 }
 
 /******************************************************************************
-                              Static Linkage
+			      Static Linkage
 ******************************************************************************/
 
 /* udc_state_transition_up
@@ -633,10 +630,10 @@
  * state, then no state transitions will take place.
  *
  */
- 
+
 static void mpc8xx_udc_state_transition_up (usb_device_state_t initial,
-				     usb_device_state_t final)
-{		
+					    usb_device_state_t final)
+{
 	if (initial < final) {
 		switch (initial) {
 		case STATE_ATTACHED:
@@ -665,13 +662,13 @@
 }
 
 static void mpc8xx_udc_state_transition_down (usb_device_state_t initial,
-				       usb_device_state_t final)
+					      usb_device_state_t final)
 {
 	if (initial > final) {
 		switch (initial) {
 		case STATE_CONFIGURED:
-			usbd_device_event_irq (udc_device, 
-					DEVICE_DE_CONFIGURED, 0);
+			usbd_device_event_irq (udc_device,
+					       DEVICE_DE_CONFIGURED, 0);
 			if (final == STATE_ADDRESSED)
 				break;
 		case STATE_ADDRESSED:
@@ -679,13 +676,13 @@
 			if (final == STATE_DEFAULT)
 				break;
 		case STATE_DEFAULT:
-			usbd_device_event_irq (udc_device, 
-					DEVICE_POWER_INTERRUPTION, 0);
+			usbd_device_event_irq (udc_device,
+					       DEVICE_POWER_INTERRUPTION, 0);
 			if (final == STATE_POWERED)
 				break;
 		case STATE_POWERED:
 			usbd_device_event_irq (udc_device, DEVICE_HUB_RESET,
-				       	0);
+					       0);
 		case STATE_ATTACHED:
 			break;
 		default:
@@ -708,7 +705,7 @@
  *
  * Force returning of NAK responses for the given endpoint as a kind of very
  * simple flow control
- */ 
+ */
 static void mpc8xx_udc_set_nak (unsigned int ep)
 {
 	usbp->usep[ep] |= NAK_BITMASK;
@@ -720,27 +717,26 @@
  * Handle errors relevant to TX. Return a status code to allow calling
  * indicative of what if anything happened
  */
-static short mpc8xx_udc_handle_txerr()
+static short mpc8xx_udc_handle_txerr ()
 {
 	short ep = 0, ret = 0;
-	
-	for(; ep<TX_RING_SIZE; ep++){
-		if(usbp->usber&(0x10<<ep)){
-			
-			/* Timeout or underrun */
-			if(tx_cbd[ep]->cbd_sc&0x06){
-				ret = 1;
-				mpc8xx_udc_flush_tx_fifo(ep);
 
-			}else{
-				if(usbp->usep[ep]&STALL_BITMASK){
-					if(!ep){
-						usbp->usep[ep]&=
-							~STALL_BITMASK;
+	for (; ep < TX_RING_SIZE; ep++) {
+		if (usbp->usber & (0x10 << ep)) {
+
+			/* Timeout or underrun */
+			if (tx_cbd[ep]->cbd_sc & 0x06) {
+				ret = 1;
+				mpc8xx_udc_flush_tx_fifo (ep);
+
+			} else {
+				if (usbp->usep[ep] & STALL_BITMASK) {
+					if (!ep) {
+						usbp->usep[ep] &= ~STALL_BITMASK;
 					}
-				}/* else NAK */
+				}	/* else NAK */
 			}
-			usbp->usber|=(0x10<<ep);
+			usbp->usber |= (0x10 << ep);
 		}
 	}
 	return ret;
@@ -750,13 +746,12 @@
  *
  * Advance cbd rx
  */
-static void mpc8xx_udc_advance_rx(volatile cbd_t ** rx_cbdp, int epid)
+static void mpc8xx_udc_advance_rx (volatile cbd_t ** rx_cbdp, int epid)
 {
-	if((*rx_cbdp)->cbd_sc & RX_BD_W){
-		*rx_cbdp  = (volatile cbd_t*)
-			(endpoints[epid]->rbase + CFG_IMMR);
-			
-	}else{
+	if ((*rx_cbdp)->cbd_sc & RX_BD_W) {
+		*rx_cbdp = (volatile cbd_t *) (endpoints[epid]->rbase + CFG_IMMR);
+
+	} else {
 		(*rx_cbdp)++;
 	}
 }
@@ -766,34 +761,34 @@
  *
  * Flush a given TX fifo. Assumes one tx cbd per endpoint
  */
-static void mpc8xx_udc_flush_tx_fifo(int epid)
-{	
-	volatile cbd_t * tx_cbdp = 0;
+static void mpc8xx_udc_flush_tx_fifo (int epid)
+{
+	volatile cbd_t *tx_cbdp = 0;
 
-	if(epid > MAX_ENDPOINTS){
+	if (epid > MAX_ENDPOINTS) {
 		return;
 	}
 
 	/* TX stop */
-	immr->im_cpm.cp_cpcr = ((epid<<2) | 0x1D01);
+	immr->im_cpm.cp_cpcr = ((epid << 2) | 0x1D01);
 	__asm__ ("eieio");
-	while(immr->im_cpm.cp_cpcr & 0x01);
-	
+	while (immr->im_cpm.cp_cpcr & 0x01);
+
 	usbp->uscom = 0x40 | 0;
-	
+
 	/* reset ring */
-	tx_cbdp = (cbd_t*)(endpoints[epid]->tbptr + CFG_IMMR);
+	tx_cbdp = (cbd_t *) (endpoints[epid]->tbptr + CFG_IMMR);
 	tx_cbdp->cbd_sc = (TX_BD_I | TX_BD_W);
 
-		
+
 	endpoints[epid]->tptr = endpoints[epid]->tbase;
-	endpoints[epid]->tstate	= 0x00;
-	endpoints[epid]->tbcnt	= 0x00;
+	endpoints[epid]->tstate = 0x00;
+	endpoints[epid]->tbcnt = 0x00;
 
 	/* TX start */
-	immr->im_cpm.cp_cpcr = ((epid<<2) | 0x2D01);
+	immr->im_cpm.cp_cpcr = ((epid << 2) | 0x2D01);
 	__asm__ ("eieio");
-	while(immr->im_cpm.cp_cpcr & 0x01);
+	while (immr->im_cpm.cp_cpcr & 0x01);
 
 	return;
 }
@@ -807,28 +802,29 @@
  * we have accepted data but, the CPM found it had no-where to put that data
  * which needless to say would be a bad thing.
  */
-static void mpc8xx_udc_flush_rx_fifo()
+static void mpc8xx_udc_flush_rx_fifo ()
 {
 	int i = 0;
-	for(i = 0;i<RX_RING_SIZE; i++){
-		if(!(rx_cbd[i]->cbd_sc&RX_BD_E)){
-			ERR("buf %p used rx data len = 0x%x sc=0x%x!\n",
-				rx_cbd[i], rx_cbd[i]->cbd_datlen, 
-				rx_cbd[i]->cbd_sc);
+
+	for (i = 0; i < RX_RING_SIZE; i++) {
+		if (!(rx_cbd[i]->cbd_sc & RX_BD_E)) {
+			ERR ("buf %p used rx data len = 0x%x sc=0x%x!\n",
+			     rx_cbd[i], rx_cbd[i]->cbd_datlen,
+			     rx_cbd[i]->cbd_sc);
 
 		}
 	}
-	ERR("BUG : Input over-run\n");	
+	ERR ("BUG : Input over-run\n");
 }
 
 /* mpc8xx_udc_clear_rxbd
- * 
+ *
  * Release control of RX CBD to CP.
  */
-static void mpc8xx_udc_clear_rxbd(volatile cbd_t * rx_cbdp)
+static void mpc8xx_udc_clear_rxbd (volatile cbd_t * rx_cbdp)
 {
 	rx_cbdp->cbd_datlen = 0x0000;
-	rx_cbdp->cbd_sc= ((rx_cbdp->cbd_sc & RX_BD_W)|(RX_BD_E | RX_BD_I));
+	rx_cbdp->cbd_sc = ((rx_cbdp->cbd_sc & RX_BD_W) | (RX_BD_E | RX_BD_I));
 	__asm__ ("eieio");
 }
 
@@ -837,27 +833,27 @@
  * Parse for tx timeout, control RX or USB reset/busy conditions
  * Return -1 on timeout, -2 on fatal error, else return zero
  */
-static int mpc8xx_udc_tx_irq(int ep)
+static int mpc8xx_udc_tx_irq (int ep)
 {
 	int i = 0;
 
-	if(usbp->usber&(USB_TX_ERRMASK)){
-		if(mpc8xx_udc_handle_txerr()){
+	if (usbp->usber & (USB_TX_ERRMASK)) {
+		if (mpc8xx_udc_handle_txerr ()) {
 			/* Timeout, controlling function must retry send */
 			return -1;
 		}
 	}
 
-	if(usbp->usber & (USB_E_RESET|USB_E_BSY)){
+	if (usbp->usber & (USB_E_RESET | USB_E_BSY)) {
 		/* Fatal, abandon TX transaction */
 		return -2;
 	}
-	
-	if(usbp->usber & USB_E_RXB){
-		for(i = 0;i<RX_RING_SIZE; i++){
-			if(!(rx_cbd[i]->cbd_sc&RX_BD_E)){
-				if((rx_cbd[i] == ep_ref[0].prx) || ep){
-					return -2;	
+
+	if (usbp->usber & USB_E_RXB) {
+		for (i = 0; i < RX_RING_SIZE; i++) {
+			if (!(rx_cbd[i]->cbd_sc & RX_BD_E)) {
+				if ((rx_cbd[i] == ep_ref[0].prx) || ep) {
+					return -2;
 				}
 			}
 		}
@@ -875,106 +871,106 @@
  * devices to give up TX, however tx_retry stops us getting stuck in an endless
  * TX loop.
  */
-static int mpc8xx_udc_ep_tx (struct usb_endpoint_instance *epi) 
+static int mpc8xx_udc_ep_tx (struct usb_endpoint_instance *epi)
 {
 	struct urb *urb = epi->tx_urb;
-	volatile cbd_t * tx_cbdp = 0;
+	volatile cbd_t *tx_cbdp = 0;
 	unsigned int ep = 0, pkt_len = 0, x = 0, tx_retry = 0;
 	int ret = 0;
-	
-	if(!epi || (epi->endpoint_address&0x03)>=MAX_ENDPOINTS || !urb){
+
+	if (!epi || (epi->endpoint_address & 0x03) >= MAX_ENDPOINTS || !urb) {
 		return -1;
 	}
 
 	ep = epi->endpoint_address & 0x03;
-	tx_cbdp = (cbd_t*)(endpoints[ep]->tbptr + CFG_IMMR);
-		
-	if(tx_cbdp->cbd_sc&TX_BD_R || usbp->usber&USB_E_TXB){
-		mpc8xx_udc_flush_tx_fifo(ep);
+	tx_cbdp = (cbd_t *) (endpoints[ep]->tbptr + CFG_IMMR);
+
+	if (tx_cbdp->cbd_sc & TX_BD_R || usbp->usber & USB_E_TXB) {
+		mpc8xx_udc_flush_tx_fifo (ep);
 		usbp->usber |= USB_E_TXB;
 	};
 
-	while(tx_retry++ < 100){
-		ret = mpc8xx_udc_tx_irq(ep);
-		if(ret == -1){
+	while (tx_retry++ < 100) {
+		ret = mpc8xx_udc_tx_irq (ep);
+		if (ret == -1) {
 			/* ignore timeout here */
-		}else if(ret == -2){
+		} else if (ret == -2) {
 			/* Abandon TX */
-			mpc8xx_udc_flush_tx_fifo(ep);	
+			mpc8xx_udc_flush_tx_fifo (ep);
 			return -1;
-		}	
-
-		tx_cbdp = (cbd_t*)(endpoints[ep]->tbptr + CFG_IMMR);
-		while(tx_cbdp->cbd_sc&TX_BD_R){};
-		tx_cbdp->cbd_sc = (tx_cbdp->cbd_sc&TX_BD_W);
-	
-		pkt_len = urb->actual_length - epi->sent;
-
-		if(pkt_len> epi->tx_packetSize || pkt_len > EP_MAX_PKT){
-			pkt_len = MIN(epi->tx_packetSize, EP_MAX_PKT);
 		}
 
-		for(x=0; x<pkt_len; x++){
-			*((unsigned char*)(tx_cbdp->cbd_bufaddr+x)) = 
+		tx_cbdp = (cbd_t *) (endpoints[ep]->tbptr + CFG_IMMR);
+		while (tx_cbdp->cbd_sc & TX_BD_R) {
+		};
+		tx_cbdp->cbd_sc = (tx_cbdp->cbd_sc & TX_BD_W);
+
+		pkt_len = urb->actual_length - epi->sent;
+
+		if (pkt_len > epi->tx_packetSize || pkt_len > EP_MAX_PKT) {
+			pkt_len = MIN (epi->tx_packetSize, EP_MAX_PKT);
+		}
+
+		for (x = 0; x < pkt_len; x++) {
+			*((unsigned char *) (tx_cbdp->cbd_bufaddr + x)) =
 				urb->buffer[epi->sent + x];
 		}
 		tx_cbdp->cbd_datlen = pkt_len;
-		tx_cbdp->cbd_sc|=(CBD_TX_BITMASK | ep_ref[ep].pid);
+		tx_cbdp->cbd_sc |= (CBD_TX_BITMASK | ep_ref[ep].pid);
 		__asm__ ("eieio");
 
-		#ifdef __SIMULATE_ERROR__
-			if(++err_poison_test == 2){
-				err_poison_test = 0;
-				tx_cbdp->cbd_sc&=~TX_BD_TC;
-			}
-		#endif
+#ifdef __SIMULATE_ERROR__
+		if (++err_poison_test == 2) {
+			err_poison_test = 0;
+			tx_cbdp->cbd_sc &= ~TX_BD_TC;
+		}
+#endif
 
-		usbp->uscom = (USCOM_STR | ep); 
+		usbp->uscom = (USCOM_STR | ep);
 
-		while(!(usbp->usber&USB_E_TXB)){
-			ret = mpc8xx_udc_tx_irq(ep);
-			if(ret == -1){
+		while (!(usbp->usber & USB_E_TXB)) {
+			ret = mpc8xx_udc_tx_irq (ep);
+			if (ret == -1) {
 				/* TX timeout */
 				break;
-			}else if(ret == -2){
-				if(usbp->usber & USB_E_TXB){
-					usbp->usber|=USB_E_TXB;
+			} else if (ret == -2) {
+				if (usbp->usber & USB_E_TXB) {
+					usbp->usber |= USB_E_TXB;
 				}
-				mpc8xx_udc_flush_tx_fifo(ep);	
+				mpc8xx_udc_flush_tx_fifo (ep);
 				return -1;
 			}
 		};
 
-		if(usbp->usber & USB_E_TXB){
-			usbp->usber|=USB_E_TXB;
+		if (usbp->usber & USB_E_TXB) {
+			usbp->usber |= USB_E_TXB;
 		}
 
 		/* ACK must be present <= 18bit times from TX */
-		if(ret == -1){
+		if (ret == -1) {
 			continue;
 		}
-	
+
 		/* TX ACK : USB 2.0 8.7.2, Toggle PID, Advance TX */
 		epi->sent += pkt_len;
-		epi->last = MIN (urb->actual_length - epi->sent, 
-				epi->tx_packetSize);
-		TOGGLE_TX_PID(ep_ref[ep].pid);
+		epi->last = MIN (urb->actual_length - epi->sent, epi->tx_packetSize);
+		TOGGLE_TX_PID (ep_ref[ep].pid);
 
-		if(epi->sent >= epi->tx_urb->actual_length){
-			
+		if (epi->sent >= epi->tx_urb->actual_length) {
+
 			epi->tx_urb->actual_length = 0;
 			epi->sent = 0;
-			
-			if(ep_ref[ep].sc & EP_SEND_ZLP){
+
+			if (ep_ref[ep].sc & EP_SEND_ZLP) {
 				ep_ref[ep].sc &= ~EP_SEND_ZLP;
-			}else{
+			} else {
 				return 0;
 			}
 		}
 	}
-	
-	ERR("TX fail, endpoint 0x%x tx bytes 0x%x/0x%x\n",ep, epi->sent,
-		epi->tx_urb->actual_length);
+
+	ERR ("TX fail, endpoint 0x%x tx bytes 0x%x/0x%x\n", ep, epi->sent,
+	     epi->tx_urb->actual_length);
 
 	return -1;
 }
@@ -983,126 +979,117 @@
  *
  * Dump a control request to console
  */
-static void mpc8xx_udc_dump_request(struct usb_device_request *request)
+static void mpc8xx_udc_dump_request (struct usb_device_request *request)
 {
-	DBG(
-	"bmRequestType:%02x bRequest:%02x wValue:%04x "
-	"wIndex:%04x wLength:%04x ?\n",
-		request->bmRequestType,
-		request->bRequest,
-		request->wValue,
-		request->wIndex,
-		request->wLength);
+	DBG ("bmRequestType:%02x bRequest:%02x wValue:%04x "
+	     "wIndex:%04x wLength:%04x ?\n",
+	     request->bmRequestType,
+	     request->bRequest,
+	     request->wValue, request->wIndex, request->wLength);
 
 	return;
 }
 
-/* mpc8xx_udc_ep0_rx_setup 
- * 
+/* mpc8xx_udc_ep0_rx_setup
+ *
  * Decode received ep0 SETUP packet. return non-zero on error
  */
 static int mpc8xx_udc_ep0_rx_setup (volatile cbd_t * rx_cbdp)
 {
 	unsigned int x = 0;
-	struct urb * purb = ep_ref[0].urb;
-	struct usb_endpoint_instance *epi = 
+	struct urb *purb = ep_ref[0].urb;
+	struct usb_endpoint_instance *epi =
 		&udc_device->bus->endpoint_array[0];
 
-	for(; x<rx_cbdp->cbd_datlen; x++){
-		*(((unsigned char*)&ep_ref[0].urb->device_request)+x) = 
-			*((unsigned char*)(rx_cbdp->cbd_bufaddr+x));
+	for (; x < rx_cbdp->cbd_datlen; x++) {
+		*(((unsigned char *) &ep_ref[0].urb->device_request) + x) =
+			*((unsigned char *) (rx_cbdp->cbd_bufaddr + x));
 	}
-	
-	mpc8xx_udc_clear_rxbd(rx_cbdp);	
 
-	if (ep0_recv_setup(purb)) {
-		mpc8xx_udc_dump_request(&purb->device_request);
+	mpc8xx_udc_clear_rxbd (rx_cbdp);
+
+	if (ep0_recv_setup (purb)) {
+		mpc8xx_udc_dump_request (&purb->device_request);
 		return -1;
 	}
 
-	if ((purb->device_request.bmRequestType&USB_REQ_DIRECTION_MASK)
+	if ((purb->device_request.bmRequestType & USB_REQ_DIRECTION_MASK)
 	    == USB_REQ_HOST2DEVICE) {
 
-		switch (purb->device_request.bRequest){
-			case USB_REQ_SET_ADDRESS:
-				/* Send the Status OUT ZLP */
-				ep_ref[0].pid = TX_BD_PID_DATA1;
-				purb->actual_length = 0;
-				mpc8xx_udc_init_tx(epi,purb);
-				mpc8xx_udc_ep_tx(epi);
-				
-				/* Move to the addressed state */
-				usbp->usaddr = udc_device->address;
-				mpc8xx_udc_state_transition_up(udc_device->device_state,
-					STATE_ADDRESSED);
-				return 0;
+		switch (purb->device_request.bRequest) {
+		case USB_REQ_SET_ADDRESS:
+			/* Send the Status OUT ZLP */
+			ep_ref[0].pid = TX_BD_PID_DATA1;
+			purb->actual_length = 0;
+			mpc8xx_udc_init_tx (epi, purb);
+			mpc8xx_udc_ep_tx (epi);
 
-			case USB_REQ_SET_CONFIGURATION:
-				if(!purb->device_request.wValue){
-					
-					/* Respond at default address */
-					usbp->usaddr = 0x00;	
-					mpc8xx_udc_state_transition_down(udc_device->device_state,
-						STATE_ADDRESSED);
+			/* Move to the addressed state */
+			usbp->usaddr = udc_device->address;
+			mpc8xx_udc_state_transition_up (udc_device->device_state,
+							STATE_ADDRESSED);
+			return 0;
 
-				} else {
-					
-					/* TODO: Support multiple configurations */
-					mpc8xx_udc_state_transition_up(udc_device->device_state,STATE_CONFIGURED);
-					for(x=1; x<MAX_ENDPOINTS; x++){
-						if((udc_device->bus->endpoint_array[x].endpoint_address&USB_ENDPOINT_DIR_MASK) 
-							== USB_DIR_IN){
-							ep_ref[x].pid = TX_BD_PID_DATA0;
-						}else{
-							ep_ref[x].pid = RX_BD_PID_DATA0;
-						}
-						/* Set configuration must unstall endpoints */
-						usbp->usep[x]&=~STALL_BITMASK;
+		case USB_REQ_SET_CONFIGURATION:
+			if (!purb->device_request.wValue) {
+				/* Respond at default address */
+				usbp->usaddr = 0x00;
+				mpc8xx_udc_state_transition_down (udc_device->device_state,
+								  STATE_ADDRESSED);
+			} else {
+				/* TODO: Support multiple configurations */
+				mpc8xx_udc_state_transition_up (udc_device->device_state,
+								STATE_CONFIGURED);
+				for (x = 1; x < MAX_ENDPOINTS; x++) {
+					if ((udc_device->bus->endpoint_array[x].endpoint_address & USB_ENDPOINT_DIR_MASK)
+					    == USB_DIR_IN) {
+						ep_ref[x].pid = TX_BD_PID_DATA0;
+					} else {
+						ep_ref[x].pid = RX_BD_PID_DATA0;
 					}
-
+					/* Set configuration must unstall endpoints */
+					usbp->usep[x] &= ~STALL_BITMASK;
 				}
-				break;
-			default:
-				/* CDC/Vendor specific */
-				break;
+			}
+			break;
+		default:
+			/* CDC/Vendor specific */
+			break;
 		}
 
 		/* Send ZLP as ACK in Status OUT phase */
 		ep_ref[0].pid = TX_BD_PID_DATA1;
 		purb->actual_length = 0;
-		mpc8xx_udc_init_tx(epi,purb);
-		mpc8xx_udc_ep_tx(epi);
+		mpc8xx_udc_init_tx (epi, purb);
+		mpc8xx_udc_ep_tx (epi);
 
-	}else{
-		if(purb->actual_length){
+	} else {
+
+		if (purb->actual_length) {
 			ep_ref[0].pid = TX_BD_PID_DATA1;
-			mpc8xx_udc_init_tx(epi,purb);
+			mpc8xx_udc_init_tx (epi, purb);
 
-			if(!(purb->actual_length%EP0_MAX_PACKET_SIZE)){
+			if (!(purb->actual_length % EP0_MAX_PACKET_SIZE)) {
 				ep_ref[0].sc |= EP_SEND_ZLP;
 			}
 
-			if(purb->device_request.wValue==
-					USB_DESCRIPTOR_TYPE_DEVICE){
-				if(le16_to_cpu(purb->device_request.wLength)>
-						purb->actual_length){
+			if (purb->device_request.wValue ==
+			    USB_DESCRIPTOR_TYPE_DEVICE) {
+				if (le16_to_cpu (purb->device_request.wLength)
+				    > purb->actual_length) {
 					/* Send EP0_MAX_PACKET_SIZE bytes
 					 * unless correct size requested.
 					 */
-					if(purb->actual_length > 
-							epi->tx_packetSize){
-						
-						purb->actual_length =
-							epi->tx_packetSize;
+					if (purb->actual_length > epi->tx_packetSize) {
+						purb->actual_length = epi->tx_packetSize;
 					}
-					
 				}
 			}
-			mpc8xx_udc_ep_tx(epi);
+			mpc8xx_udc_ep_tx (epi);
 
-		}else{
+		} else {
 			/* Corrupt SETUP packet? */
-			ERR("Zero length data or SETUP with DATA-IN phase ?\n");
+			ERR ("Zero length data or SETUP with DATA-IN phase ?\n");
 			return 1;
 		}
 	}
@@ -1113,8 +1100,8 @@
  *
  * Setup some basic parameters for a TX transaction
  */
-static void mpc8xx_udc_init_tx(struct usb_endpoint_instance *epi, 
-		struct urb * tx_urb)
+static void mpc8xx_udc_init_tx (struct usb_endpoint_instance *epi,
+				struct urb *tx_urb)
 {
 	epi->sent = 0;
 	epi->last = 0;
@@ -1125,24 +1112,24 @@
  *
  * Receive ep0/control USB data. Parse and possibly send a response.
  */
-static void mpc8xx_udc_ep0_rx(volatile cbd_t * rx_cbdp)
+static void mpc8xx_udc_ep0_rx (volatile cbd_t * rx_cbdp)
 {
-	if(rx_cbdp->cbd_sc&RX_BD_PID_SETUP){
-		
+	if (rx_cbdp->cbd_sc & RX_BD_PID_SETUP) {
+
 		/* Unconditionally accept SETUP packets */
-		if(mpc8xx_udc_ep0_rx_setup(rx_cbdp)){
-			mpc8xx_udc_stall (0);	
+		if (mpc8xx_udc_ep0_rx_setup (rx_cbdp)) {
+			mpc8xx_udc_stall (0);
 		}
-		
+
 	} else {
-		
-		mpc8xx_udc_clear_rxbd(rx_cbdp);
-		
-		if((rx_cbdp->cbd_datlen-2)){
+
+		mpc8xx_udc_clear_rxbd (rx_cbdp);
+
+		if ((rx_cbdp->cbd_datlen - 2)) {
 			/* SETUP with a DATA phase
-		 	 * outside of SETUP packet.
-		 	 * Reply with STALL.
-		 	 */
+			 * outside of SETUP packet.
+			 * Reply with STALL.
+			 */
 			mpc8xx_udc_stall (0);
 		}
 	}
@@ -1151,7 +1138,7 @@
 /* mpc8xx_udc_epn_rx
  *
  * Receive some data from cbd into USB system urb data abstraction
- * Upper layers should NAK if there is insufficient RX data space 
+ * Upper layers should NAK if there is insufficient RX data space
  */
 static int mpc8xx_udc_epn_rx (unsigned int epid, volatile cbd_t * rx_cbdp)
 {
@@ -1159,115 +1146,115 @@
 	struct urb *urb = 0;
 	unsigned int x = 0;
 
-	if(epid >= MAX_ENDPOINTS || !rx_cbdp->cbd_datlen){
+	if (epid >= MAX_ENDPOINTS || !rx_cbdp->cbd_datlen) {
 		return 0;
 	}
-	
-	/* USB 2.0 PDF section 8.6.4 
+
+	/* USB 2.0 PDF section 8.6.4
 	 * Discard data with invalid PID it is a resend.
 	 */
-	if(ep_ref[epid].pid!=(rx_cbdp->cbd_sc&0xC0)){
+	if (ep_ref[epid].pid != (rx_cbdp->cbd_sc & 0xC0)) {
 		return 1;
 	}
-	TOGGLE_RX_PID(ep_ref[epid].pid);
-	
+	TOGGLE_RX_PID (ep_ref[epid].pid);
+
 	epi = &udc_device->bus->endpoint_array[epid];
 	urb = epi->rcv_urb;
 
-	for(; x<(rx_cbdp->cbd_datlen-2); x++){
-		*((unsigned char*)(urb->buffer + urb->actual_length +x)) =
-			*((unsigned char*)(rx_cbdp->cbd_bufaddr+x));
+	for (; x < (rx_cbdp->cbd_datlen - 2); x++) {
+		*((unsigned char *) (urb->buffer + urb->actual_length + x)) =
+			*((unsigned char *) (rx_cbdp->cbd_bufaddr + x));
 	}
 
-	if(x){
+	if (x) {
 		usbd_rcv_complete (epi, x, 0);
-		if(ep_ref[epid].urb->status == RECV_ERROR){
-			DBG("RX error unset NAK\n");
-			udc_unset_nak(epid);
+		if (ep_ref[epid].urb->status == RECV_ERROR) {
+			DBG ("RX error unset NAK\n");
+			udc_unset_nak (epid);
 		}
-	}	
+	}
 	return x;
 }
 
 /* mpc8xx_udc_clock_init
  *
- * Obtain a clock reference for Full Speed Signaling 
+ * Obtain a clock reference for Full Speed Signaling
  */
-static void mpc8xx_udc_clock_init (volatile immap_t * immr, 
-                                   volatile cpm8xx_t * cp)
+static void mpc8xx_udc_clock_init (volatile immap_t * immr,
+				   volatile cpm8xx_t * cp)
 {
 
 #if defined(CFG_USB_EXTC_CLK)
 
 	/* This has been tested with a 48MHz crystal on CLK6 */
-	switch(CFG_USB_EXTC_CLK){
-		case 1:
-			immr->im_ioport.iop_papar|= 0x0100;
-			immr->im_ioport.iop_padir&= ~0x0100;
-			cp->cp_sicr|= 0x24;
-			break;
-		case 2:
-		 	immr->im_ioport.iop_papar|= 0x0200;
-			immr->im_ioport.iop_padir&= ~0x0200;
-			cp->cp_sicr|= 0x2D; 
-			break;
-		case 3:
-			immr->im_ioport.iop_papar|= 0x0400;
-			immr->im_ioport.iop_padir&= ~0x0400;
-			cp->cp_sicr|= 0x36; 
-			break;
-		case 4:
-			immr->im_ioport.iop_papar|= 0x0800;
-			immr->im_ioport.iop_padir&= ~0x0800;
-			cp->cp_sicr|= 0x3F; 
-			break;
-		default:
-			udc_state = STATE_ERROR;
-			break;
+	switch (CFG_USB_EXTC_CLK) {
+	case 1:
+		immr->im_ioport.iop_papar |= 0x0100;
+		immr->im_ioport.iop_padir &= ~0x0100;
+		cp->cp_sicr |= 0x24;
+		break;
+	case 2:
+		immr->im_ioport.iop_papar |= 0x0200;
+		immr->im_ioport.iop_padir &= ~0x0200;
+		cp->cp_sicr |= 0x2D;
+		break;
+	case 3:
+		immr->im_ioport.iop_papar |= 0x0400;
+		immr->im_ioport.iop_padir &= ~0x0400;
+		cp->cp_sicr |= 0x36;
+		break;
+	case 4:
+		immr->im_ioport.iop_papar |= 0x0800;
+		immr->im_ioport.iop_padir &= ~0x0800;
+		cp->cp_sicr |= 0x3F;
+		break;
+	default:
+		udc_state = STATE_ERROR;
+		break;
 	}
 
 #elif defined(CFG_USB_BRGCLK)
 
-	/* This has been tested with brgclk == 50MHz */	
+	/* This has been tested with brgclk == 50MHz */
 	DECLARE_GLOBAL_DATA_PTR;
 	int divisor = 0;
 
-	if(gd->cpu_clk<48000000L){
-		ERR("brgclk is too slow for full-speed USB!\n");
+	if (gd->cpu_clk < 48000000L) {
+		ERR ("brgclk is too slow for full-speed USB!\n");
 		udc_state = STATE_ERROR;
 		return;
 	}
 
 	/* Assume the brgclk is 'good enough', we want !(gd->cpu_clk%48Mhz)
 	 * but, can /probably/ live with close-ish alternative rates.
-	 */	
-	divisor = (gd->cpu_clk/48000000L)-1;
+	 */
+	divisor = (gd->cpu_clk / 48000000L) - 1;
 	cp->cp_sicr &= ~0x0000003F;
-		
-	switch(CFG_USB_BRGCLK){
-		case 1:
-			cp->cp_brgc1 |= (divisor|CPM_BRG_EN);
-			cp->cp_sicr &= ~0x2F;
-			break;
-		case 2:
-			cp->cp_brgc2 |= (divisor|CPM_BRG_EN);
-			cp->cp_sicr  |= 0x00000009;
-			break;
-		case 3:
-			cp->cp_brgc3 |= (divisor|CPM_BRG_EN);
-			cp->cp_sicr  |= 0x00000012;
-			break;
-		case 4:
-			cp->cp_brgc4 = (divisor|CPM_BRG_EN);
-			cp->cp_sicr  |= 0x0000001B; 
-			break;
-		default:
-			udc_state = STATE_ERROR;
-			break;
+
+	switch (CFG_USB_BRGCLK) {
+	case 1:
+		cp->cp_brgc1 |= (divisor | CPM_BRG_EN);
+		cp->cp_sicr &= ~0x2F;
+		break;
+	case 2:
+		cp->cp_brgc2 |= (divisor | CPM_BRG_EN);
+		cp->cp_sicr |= 0x00000009;
+		break;
+	case 3:
+		cp->cp_brgc3 |= (divisor | CPM_BRG_EN);
+		cp->cp_sicr |= 0x00000012;
+		break;
+	case 4:
+		cp->cp_brgc4 = (divisor | CPM_BRG_EN);
+		cp->cp_sicr |= 0x0000001B;
+		break;
+	default:
+		udc_state = STATE_ERROR;
+		break;
 	}
 
 #else
-	#error "CFG_USB_EXTC_CLK or CFG_USB_BRGCLK must be defined"
+#error "CFG_USB_EXTC_CLK or CFG_USB_BRGCLK must be defined"
 #endif
 
 }
@@ -1278,51 +1265,51 @@
  */
 static void mpc8xx_udc_cbd_attach (int ep, uchar tx_size, uchar rx_size)
 {
-	
-	if (!tx_cbd[ep] || !rx_cbd[ep] || ep >= MAX_ENDPOINTS){
+
+	if (!tx_cbd[ep] || !rx_cbd[ep] || ep >= MAX_ENDPOINTS) {
 		udc_state = STATE_ERROR;
 		return;
 	}
 
-	if (tx_size>USB_MAX_PKT || rx_size>USB_MAX_PKT ||
-		(!tx_size && !rx_size)){
+	if (tx_size > USB_MAX_PKT || rx_size > USB_MAX_PKT ||
+	    (!tx_size && !rx_size)) {
 		udc_state = STATE_ERROR;
 		return;
 	}
 
 	/* Attach CBD to appropiate Parameter RAM Endpoint data structure */
-	if(rx_size){
-		endpoints[ep]->rbase = (u32)rx_cbd[rx_ct];
-		endpoints[ep]->rbptr = (u32)rx_cbd[rx_ct];
+	if (rx_size) {
+		endpoints[ep]->rbase = (u32) rx_cbd[rx_ct];
+		endpoints[ep]->rbptr = (u32) rx_cbd[rx_ct];
 		rx_ct++;
 
-		if(!ep){
-			
-			endpoints[ep]->rbptr = (u32)rx_cbd[rx_ct];	
+		if (!ep) {
+
+			endpoints[ep]->rbptr = (u32) rx_cbd[rx_ct];
 			rx_cbd[rx_ct]->cbd_sc |= RX_BD_W;
 			rx_ct++;
 
-		}else{
+		} else {
 			rx_ct += 2;
-			endpoints[ep]->rbptr = (u32)rx_cbd[rx_ct];	
+			endpoints[ep]->rbptr = (u32) rx_cbd[rx_ct];
 			rx_cbd[rx_ct]->cbd_sc |= RX_BD_W;
 			rx_ct++;
 		}
 
 		/* Where we expect to RX data on this endpoint */
-		ep_ref[ep].prx = rx_cbd[rx_ct-1];
-	}else{
+		ep_ref[ep].prx = rx_cbd[rx_ct - 1];
+	} else {
 
 		ep_ref[ep].prx = 0;
 		endpoints[ep]->rbase = 0;
 		endpoints[ep]->rbptr = 0;
 	}
 
-	if(tx_size){
-		endpoints[ep]->tbase = (u32)tx_cbd[tx_ct];
-		endpoints[ep]->tbptr = (u32)tx_cbd[tx_ct];
+	if (tx_size) {
+		endpoints[ep]->tbase = (u32) tx_cbd[tx_ct];
+		endpoints[ep]->tbptr = (u32) tx_cbd[tx_ct];
 		tx_ct++;
-	}else{
+	} else {
 		endpoints[ep]->tbase = 0;
 		endpoints[ep]->tbptr = 0;
 	}
@@ -1330,13 +1317,14 @@
 	endpoints[ep]->tstate = 0;
 	endpoints[ep]->tbcnt = 0;
 	endpoints[ep]->mrblr = EP_MAX_PKT;
-	endpoints[ep]->rfcr = 0x18;	
+	endpoints[ep]->rfcr = 0x18;
 	endpoints[ep]->tfcr = 0x18;
 	ep_ref[ep].sc |= EP_ATTACHED;
 
-	DBG("ep %d rbase 0x%08x rbptr 0x%08x tbase 0x%08x tbptr 0x%08x prx = %p\n",
-		ep, endpoints[ep]->rbase, endpoints[ep]->rbptr, endpoints[ep]->tbase,
-			endpoints[ep]->tbptr, ep_ref[ep].prx);
+	DBG ("ep %d rbase 0x%08x rbptr 0x%08x tbase 0x%08x tbptr 0x%08x prx = %p\n",
+		ep, endpoints[ep]->rbase, endpoints[ep]->rbptr,
+		endpoints[ep]->tbase, endpoints[ep]->tbptr,
+		ep_ref[ep].prx);
 
 	return;
 }
@@ -1349,28 +1337,28 @@
 {
 	int i = 0;
 
-	for(; i<TX_RING_SIZE; i++){
-		tx_cbd[i]= (cbd_t*)
-			mpc8xx_udc_alloc(sizeof(cbd_t), sizeof(int));
+	for (; i < TX_RING_SIZE; i++) {
+		tx_cbd[i] = (cbd_t *)
+			mpc8xx_udc_alloc (sizeof (cbd_t), sizeof (int));
 	}
 
-	for(i=0; i<RX_RING_SIZE; i++){
-		rx_cbd[i]= (cbd_t*)
-			mpc8xx_udc_alloc(sizeof(cbd_t),sizeof(int));
-	}	
+	for (i = 0; i < RX_RING_SIZE; i++) {
+		rx_cbd[i] = (cbd_t *)
+			mpc8xx_udc_alloc (sizeof (cbd_t), sizeof (int));
+	}
 
-	for(i=0; i< TX_RING_SIZE; i++){
-		tx_cbd[i]->cbd_bufaddr = 
-			mpc8xx_udc_alloc(EP_MAX_PKT, sizeof(int));
-			
-		tx_cbd[i]->cbd_sc = (TX_BD_I | TX_BD_W);	
+	for (i = 0; i < TX_RING_SIZE; i++) {
+		tx_cbd[i]->cbd_bufaddr =
+			mpc8xx_udc_alloc (EP_MAX_PKT, sizeof (int));
+
+		tx_cbd[i]->cbd_sc = (TX_BD_I | TX_BD_W);
 		tx_cbd[i]->cbd_datlen = 0x0000;
 	}
 
 
-	for(i=0; i< RX_RING_SIZE; i++){
-		rx_cbd[i]->cbd_bufaddr = 
-			mpc8xx_udc_alloc(EP_MAX_PKT, sizeof(int));
+	for (i = 0; i < RX_RING_SIZE; i++) {
+		rx_cbd[i]->cbd_bufaddr =
+			mpc8xx_udc_alloc (EP_MAX_PKT, sizeof (int));
 		rx_cbd[i]->cbd_sc = (RX_BD_I | RX_BD_E);
 		rx_cbd[i]->cbd_datlen = 0x0000;
 
@@ -1387,25 +1375,25 @@
 {
 	int i = 0;
 
-	for(; i<MAX_ENDPOINTS; i++){
-		endpoints[i]= (usb_epb_t*)
-			mpc8xx_udc_alloc(sizeof(usb_epb_t) , 32);
+	for (; i < MAX_ENDPOINTS; i++) {
+		endpoints[i] = (usb_epb_t *)
+			mpc8xx_udc_alloc (sizeof (usb_epb_t), 32);
 	}
 }
 
 /* mpc8xx_udc_alloc
  *
- * Grab the address of some dpram 
+ * Grab the address of some dpram
  */
 static u32 mpc8xx_udc_alloc (u32 data_size, u32 alignment)
 {
 	u32 retaddr = address_base;
-	
-	while(retaddr%alignment){
+
+	while (retaddr % alignment) {
 		retaddr++;
-	}	
-	address_base+= data_size;
-	
+	}
+	address_base += data_size;
+
 	return retaddr;
 }
 
diff --git a/drivers/usbdcore_omap1510.c b/drivers/usbdcore_omap1510.c
index 83d898f..84bb936 100644
--- a/drivers/usbdcore_omap1510.c
+++ b/drivers/usbdcore_omap1510.c
@@ -645,7 +645,7 @@
 static void omap1510_udc_setup (struct usb_endpoint_instance *endpoint)
 {
 	UDCDBG ("-> Entering device setup");
-	
+
 	do {
 		const int setup_pktsize = 8;
 		unsigned char *datap =
@@ -1518,7 +1518,7 @@
 }
 
 /**
- * udc_irq - do pseudo interrupts 
+ * udc_irq - do pseudo interrupts
  */
 void udc_irq(void)
 {
diff --git a/drivers/usbtty.c b/drivers/usbtty.c
index ed96999..d41a00b 100644
--- a/drivers/usbtty.c
+++ b/drivers/usbtty.c
@@ -1,7 +1,7 @@
 /*
  * (C) Copyright 2003
  * Gerry Hamel, geh@ti.com, Texas Instruments
- * 
+ *
  * (C) Copyright 2006
  * Bryan O'Donoghue, bodonoghue@codehermit.ie
  *
@@ -31,7 +31,7 @@
 #include "usb_cdc_acm.h"
 #include "usbdescriptors.h"
 #include <config.h>		/* If defined, override Linux identifiers with
-			   	 * vendor specific ones */	   
+			   	 * vendor specific ones */
 
 #if 0
 #define TTYDBG(fmt,args...)\
@@ -142,10 +142,10 @@
 
 struct acm_config_desc {
 	struct usb_configuration_descriptor configuration_desc;
-	
+
 	/* Master Interface */
 	struct usb_interface_descriptor interface_desc;
-	
+
 	struct usb_class_header_function_descriptor usb_class_header;
 	struct usb_class_call_management_descriptor usb_class_call_mgt;
 	struct usb_class_abstract_control_descriptor usb_class_acm;
@@ -154,22 +154,22 @@
 
 	/* Slave Interface */
 	struct usb_interface_descriptor data_class_interface;
-	struct usb_endpoint_descriptor 
+	struct usb_endpoint_descriptor
 		data_endpoints[NUM_ENDPOINTS-1] __attribute__((packed));
 } __attribute__((packed));
 
 static struct acm_config_desc acm_configuration_descriptors[NUM_CONFIGS] = {
 	{
 		.configuration_desc ={
-			.bLength = 
+			.bLength =
 				sizeof(struct usb_configuration_descriptor),
     			.bDescriptorType = USB_DT_CONFIG,
-			.wTotalLength =	 
+			.wTotalLength =
 				cpu_to_le16(sizeof(struct acm_config_desc)),
 	    		.bNumInterfaces = NUM_ACM_INTERFACES,
     			.bConfigurationValue = 1,
 			.iConfiguration = STR_CONFIG,
-			.bmAttributes = 
+			.bmAttributes =
 				BMATTRIBUTE_SELF_POWERED|BMATTRIBUTE_RESERVED,
 			.bMaxPower = USBTTY_MAXPOWER
 		},
@@ -180,62 +180,62 @@
 			.bInterfaceNumber = 0,
 			.bAlternateSetting = 0,
 			.bNumEndpoints = 0x01,
-			.bInterfaceClass = 
+			.bInterfaceClass =
 				COMMUNICATIONS_INTERFACE_CLASS_CONTROL,
 			.bInterfaceSubClass = COMMUNICATIONS_ACM_SUBCLASS,
 			.bInterfaceProtocol = COMMUNICATIONS_V25TER_PROTOCOL,
 			.iInterface = STR_CTRL_INTERFACE,
 		},
 		.usb_class_header = {
-			.bFunctionLength	= 
+			.bFunctionLength	=
 				sizeof(struct usb_class_header_function_descriptor),
-			.bDescriptorType	= CS_INTERFACE,	
+			.bDescriptorType	= CS_INTERFACE,
 			.bDescriptorSubtype	= USB_ST_HEADER,
 			.bcdCDC	= cpu_to_le16(110),
 		},
 		.usb_class_call_mgt = {
-			.bFunctionLength	= 
+			.bFunctionLength	=
 				sizeof(struct usb_class_call_management_descriptor),
 			.bDescriptorType	= CS_INTERFACE,
 			.bDescriptorSubtype	= USB_ST_CMF,
-			.bmCapabilities		= 0x00,	
-			.bDataInterface		= 0x01,	
+			.bmCapabilities		= 0x00,
+			.bDataInterface		= 0x01,
 		},
 		.usb_class_acm = {
-			.bFunctionLength	= 
+			.bFunctionLength	=
 				sizeof(struct usb_class_abstract_control_descriptor),
 			.bDescriptorType	= CS_INTERFACE,
-			.bDescriptorSubtype	= USB_ST_ACMF,	
-			.bmCapabilities		= 0x00,	
+			.bDescriptorSubtype	= USB_ST_ACMF,
+			.bmCapabilities		= 0x00,
 		},
 		.usb_class_union = {
-			.bFunctionLength	= 	
+			.bFunctionLength	=
 				sizeof(struct usb_class_union_function_descriptor),
 			.bDescriptorType	= CS_INTERFACE,
 			.bDescriptorSubtype	= USB_ST_UF,
-			.bMasterInterface	= 0x00,	
-			.bSlaveInterface0	= 0x01,	
+			.bMasterInterface	= 0x00,
+			.bSlaveInterface0	= 0x01,
 		},
 		.notification_endpoint = {
-			.bLength =		
+			.bLength =
 				sizeof(struct usb_endpoint_descriptor),
 			.bDescriptorType	= USB_DT_ENDPOINT,
 			.bEndpointAddress	= 0x01 | USB_DIR_IN,
 			.bmAttributes		= USB_ENDPOINT_XFER_INT,
-			.wMaxPacketSize		
+			.wMaxPacketSize
 				= cpu_to_le16(CONFIG_USBD_SERIAL_INT_PKTSIZE),
 			.bInterval		= 0xFF,
 		},
 
 		/* Interface 2 */
 		.data_class_interface = {
-			.bLength		= 
+			.bLength		=
 				sizeof(struct usb_interface_descriptor),
 			.bDescriptorType	= USB_DT_INTERFACE,
 			.bInterfaceNumber	= 0x01,
 			.bAlternateSetting	= 0x00,
 			.bNumEndpoints		= 0x02,
-			.bInterfaceClass	= 
+			.bInterfaceClass	=
 				COMMUNICATIONS_INTERFACE_CLASS_DATA,
 			.bInterfaceSubClass	= DATA_INTERFACE_SUBCLASS_NONE,
 			.bInterfaceProtocol	= DATA_INTERFACE_PROTOCOL_NONE,
@@ -243,30 +243,30 @@
 		},
 		.data_endpoints = {
 			{
-				.bLength		= 
+				.bLength		=
 					sizeof(struct usb_endpoint_descriptor),
 				.bDescriptorType	= USB_DT_ENDPOINT,
 				.bEndpointAddress	= 0x02 | USB_DIR_OUT,
-				.bmAttributes		= 
+				.bmAttributes		=
 					USB_ENDPOINT_XFER_BULK,
-				.wMaxPacketSize		= 
+				.wMaxPacketSize		=
 					cpu_to_le16(CONFIG_USBD_SERIAL_BULK_PKTSIZE),
 				.bInterval		= 0xFF,
 			},
 			{
-				.bLength		= 
+				.bLength		=
 					sizeof(struct usb_endpoint_descriptor),
 				.bDescriptorType	= USB_DT_ENDPOINT,
 				.bEndpointAddress	= 0x03 | USB_DIR_IN,
-				.bmAttributes		= 
+				.bmAttributes		=
 					USB_ENDPOINT_XFER_BULK,
-				.wMaxPacketSize		= 
+				.wMaxPacketSize		=
 					cpu_to_le16(CONFIG_USBD_SERIAL_BULK_PKTSIZE),
 				.bInterval		= 0xFF,
 			},
 		},
 	},
-};	
+};
 
 static struct rs232_emu rs232_desc={
 		.dter 		=  	115200,
@@ -282,75 +282,75 @@
 
 
 struct gserial_config_desc {
-	
+
 	struct usb_configuration_descriptor configuration_desc;
-	struct usb_interface_descriptor 
+	struct usb_interface_descriptor
 		interface_desc[NUM_GSERIAL_INTERFACES] __attribute__((packed));
-	struct usb_endpoint_descriptor 
+	struct usb_endpoint_descriptor
 		data_endpoints[NUM_ENDPOINTS] __attribute__((packed));
 
 } __attribute__((packed));
 
-static struct gserial_config_desc 
+static struct gserial_config_desc
 gserial_configuration_descriptors[NUM_CONFIGS] ={
 	{
 		.configuration_desc ={
 			.bLength = sizeof(struct usb_configuration_descriptor),
 			.bDescriptorType = USB_DT_CONFIG,
-			.wTotalLength =	 
+			.wTotalLength =
 				cpu_to_le16(sizeof(struct gserial_config_desc)),
 			.bNumInterfaces = NUM_GSERIAL_INTERFACES,
 			.bConfigurationValue = 1,
 			.iConfiguration = STR_CONFIG,
-			.bmAttributes = 
+			.bmAttributes =
 				BMATTRIBUTE_SELF_POWERED|BMATTRIBUTE_RESERVED,
 			.bMaxPower = USBTTY_MAXPOWER
 		},
 		.interface_desc = {
 			{
-				.bLength  = 
+				.bLength  =
 					sizeof(struct usb_interface_descriptor),
 				.bDescriptorType = USB_DT_INTERFACE,
 				.bInterfaceNumber = 0,
 				.bAlternateSetting = 0,
 				.bNumEndpoints = NUM_ENDPOINTS,
-				.bInterfaceClass = 
+				.bInterfaceClass =
 					COMMUNICATIONS_INTERFACE_CLASS_VENDOR,
-				.bInterfaceSubClass = 
+				.bInterfaceSubClass =
 					COMMUNICATIONS_NO_SUBCLASS,
-				.bInterfaceProtocol = 
+				.bInterfaceProtocol =
 					COMMUNICATIONS_NO_PROTOCOL,
 				.iInterface = STR_DATA_INTERFACE
 			},
   		},
 		.data_endpoints  = {
 			{
-				.bLength =		
+				.bLength =
 					sizeof(struct usb_endpoint_descriptor),
 				.bDescriptorType =	USB_DT_ENDPOINT,
 				.bEndpointAddress =	0x01 | USB_DIR_OUT,
 				.bmAttributes =		USB_ENDPOINT_XFER_BULK,
-				.wMaxPacketSize =	
+				.wMaxPacketSize =
 					cpu_to_le16(CONFIG_USBD_SERIAL_OUT_PKTSIZE),
 				.bInterval=		0xFF,
 			},
 			{
-				.bLength =		
+				.bLength =
 					sizeof(struct usb_endpoint_descriptor),
 				.bDescriptorType =	USB_DT_ENDPOINT,
 				.bEndpointAddress =	0x02 | USB_DIR_IN,
 				.bmAttributes =		USB_ENDPOINT_XFER_BULK,
-				.wMaxPacketSize = 	
+				.wMaxPacketSize =
 					cpu_to_le16(CONFIG_USBD_SERIAL_IN_PKTSIZE),
 				.bInterval = 		0xFF,
 			},
 			{
-				.bLength = 		
+				.bLength =
 					sizeof(struct usb_endpoint_descriptor),
 				.bDescriptorType =	USB_DT_ENDPOINT,
 				.bEndpointAddress =	0x03 | USB_DIR_IN,
 				.bmAttributes =		USB_ENDPOINT_XFER_INT,
-    				.wMaxPacketSize =	
+    				.wMaxPacketSize =
 					cpu_to_le16(CONFIG_USBD_SERIAL_INT_PKTSIZE),
 				.bInterval =		0xFF,
 			},
@@ -368,7 +368,7 @@
 static void usbtty_init_terminal_type(short type);
 static void usbtty_event_handler (struct usb_device_instance *device,
 				usb_device_event_t event, int data);
-static int usbtty_cdc_setup(struct usb_device_request *request, 
+static int usbtty_cdc_setup(struct usb_device_request *request,
 				struct urb *urb);
 static int usbtty_configured (void);
 static int write_buffer (circbuf_t * buf);
@@ -477,12 +477,12 @@
 		/* Empty buffer here, if needed, to ensure space... */
 		if (space) {
 			write_buffer (&usbtty_output);
-			
+
 			n = MIN (space, MIN (len, maxlen));
 			buf_push (&usbtty_output, str, n);
 
 			str += n;
-			len -= n;			
+			len -= n;
 		}
 	}
 }
@@ -543,7 +543,7 @@
 		tt = "generic";
 	}
 	usbtty_init_terminal_type(strcmp(tt,"cdc_acm"));
-	
+
 	/* prepare buffers... */
 	buf_init (&usbtty_input, USBTTY_BUFFER_SIZE);
 	buf_init (&usbtty_output, USBTTY_BUFFER_SIZE);
@@ -579,7 +579,7 @@
 {
 	struct usb_string_descriptor *string;
 
-	usbtty_string_table[STR_LANG] = 
+	usbtty_string_table[STR_LANG] =
 		(struct usb_string_descriptor*)wstrLang;
 
 	string = (struct usb_string_descriptor *) wstrManufacturer;
@@ -624,7 +624,7 @@
 
 	/* Now, initialize the string table for ep0 handling */
 	usb_strings = usbtty_string_table;
-}	
+}
 
 static void usbtty_init_instances (void)
 {
@@ -690,7 +690,7 @@
 
 		endpoint_instance[i].rcv_packetSize =
 			le16_to_cpu(ep_descriptor_ptrs[i - 1]->wMaxPacketSize);
-		
+
 		endpoint_instance[i].tx_attributes =
 			ep_descriptor_ptrs[i - 1]->bmAttributes;
 
@@ -721,30 +721,30 @@
 	int i;
 
 	bus_instance->max_endpoints = NUM_ENDPOINTS + 1;
-	for (i = 1; i <= NUM_ENDPOINTS; i++) {		
+	for (i = 1; i <= NUM_ENDPOINTS; i++) {
 		udc_setup_ep (device_instance, i, &endpoint_instance[i]);
 	}
 }
 
 /* usbtty_init_terminal_type
- * 
+ *
  * Do some late binding for our device type.
  */
 static void usbtty_init_terminal_type(short type)
 {
 	switch(type){
-		/* CDC ACM */			
+		/* CDC ACM */
 		case 0:
 			/* Assign endpoint descriptors */
-			ep_descriptor_ptrs[0] = 
+			ep_descriptor_ptrs[0] =
 				&acm_configuration_descriptors[0].notification_endpoint;
-			ep_descriptor_ptrs[1] = 
+			ep_descriptor_ptrs[1] =
 				&acm_configuration_descriptors[0].data_endpoints[0];
-			ep_descriptor_ptrs[2] = 
+			ep_descriptor_ptrs[2] =
 				&acm_configuration_descriptors[0].data_endpoints[1];
 
 			/* Enumerate Device Descriptor */
-			device_descriptor.bDeviceClass = 
+			device_descriptor.bDeviceClass =
 				COMMUNICATIONS_DEVICE_CLASS;
 			device_descriptor.idProduct =
 				cpu_to_le16(CONFIG_USBD_PRODUCTID_CDCACM);
@@ -752,7 +752,7 @@
 			/* Assign endpoint indices */
 			tx_endpoint = ACM_TX_ENDPOINT;
 			rx_endpoint = ACM_RX_ENDPOINT;
-			
+
 			/* Configuration Descriptor */
 			configuration_descriptor =
 				(struct usb_configuration_descriptor*)
@@ -766,11 +766,11 @@
 		case 1:
 		default:
 			/* Assign endpoint descriptors */
-			ep_descriptor_ptrs[0] = 
+			ep_descriptor_ptrs[0] =
 				&gserial_configuration_descriptors[0].data_endpoints[0];
-			ep_descriptor_ptrs[1] = 
+			ep_descriptor_ptrs[1] =
 				&gserial_configuration_descriptors[0].data_endpoints[1];
-			ep_descriptor_ptrs[2] = 
+			ep_descriptor_ptrs[2] =
 				&gserial_configuration_descriptors[0].data_endpoints[2];
 
 			/* Enumerate Device Descriptor */
@@ -783,7 +783,7 @@
 			rx_endpoint = GSERIAL_RX_ENDPOINT;
 
 			/* Configuration Descriptor */
-			configuration_descriptor = 
+			configuration_descriptor =
 				(struct usb_configuration_descriptor*)
 				&gserial_configuration_descriptors;
 
@@ -832,14 +832,14 @@
 	if (!usbtty_configured ()) {
 		return 0;
 	}
-	
+
 	struct usb_endpoint_instance *endpoint =
 			&endpoint_instance[tx_endpoint];
 	struct urb *current_urb = NULL;
 
 	current_urb = next_urb (device_instance, endpoint);
-	/* TX data still exists - send it now 
-	 */	
+	/* TX data still exists - send it now
+	 */
 	if(endpoint->sent < current_urb->actual_length){
 		if(udc_endpoint_write (endpoint)){
 			/* Write pre-empted by RX */
@@ -854,11 +854,11 @@
 		int popnum, popped;
 		int total = 0;
 
-		/* Break buffer into urb sized pieces, 
-		 * and link each to the endpoint 
+		/* Break buffer into urb sized pieces,
+		 * and link each to the endpoint
 		 */
 		while (buf->size > 0) {
-			
+
 			if (!current_urb) {
 				TTYERR ("current_urb is NULL, buf->size %d\n",
 					buf->size);
@@ -881,8 +881,8 @@
 			current_urb->actual_length += popped;
 			total += popped;
 
-			/* If endpoint->last == 0, then transfers have 
-			 * not started on this endpoint 
+			/* If endpoint->last == 0, then transfers have
+			 * not started on this endpoint
 			 */
 			if (endpoint->last == 0) {
 				if(udc_endpoint_write (endpoint)){
@@ -904,7 +904,7 @@
 		&endpoint_instance[rx_endpoint];
 
 	if (endpoint->rcv_urb && endpoint->rcv_urb->actual_length) {
-		unsigned int nb = 0; 
+		unsigned int nb = 0;
 		char *src = (char *) endpoint->rcv_urb->buffer;
 		unsigned int rx_avail = buf->totalsize - buf->size;
 
@@ -913,7 +913,7 @@
 			nb = endpoint->rcv_urb->actual_length;
 			buf_push (buf, src, nb);
 			endpoint->rcv_urb->actual_length = 0;
-			
+
 		}
 		return nb;
 	}
@@ -958,7 +958,7 @@
 	   	case ACM_SEND_ENCAPSULATED_COMMAND :	/* Required */
 			break;
 		case ACM_SET_LINE_ENCODING :		/* DTE stop/parity bits
-							 * per character */		
+							 * per character */
 			break;
 	   	case ACM_GET_ENCAPSULATED_RESPONSE :	/* request response */
 			break;
@@ -986,8 +986,8 @@
 	/* New interrupts? */
 	udc_irq();
 
-	/* Write any output data to host buffer 
-	 * (do this before checking interrupts to avoid missing one) 
+	/* Write any output data to host buffer
+	 * (do this before checking interrupts to avoid missing one)
 	 */
 	if (usbtty_configured ()) {
 		write_buffer (&usbtty_output);
@@ -995,9 +995,9 @@
 
 	/* New interrupts? */
 	udc_irq();
-	
-	/* Check for new data from host.. 
-	 * (do this after checking interrupts to get latest data) 
+
+	/* Check for new data from host..
+	 * (do this after checking interrupts to get latest data)
 	 */
 	if (usbtty_configured ()) {
 		fill_buffer (&usbtty_input);
diff --git a/drivers/usbtty.h b/drivers/usbtty.h
index 731b763..8154e30 100644
--- a/drivers/usbtty.h
+++ b/drivers/usbtty.h
@@ -33,7 +33,7 @@
 
 #include <version_autogenerated.h>
 
-/* If no VendorID/ProductID is defined in config.h, pretend to be Linux 
+/* If no VendorID/ProductID is defined in config.h, pretend to be Linux
  * DO NOT Reuse this Vendor/Product setup with protocol incompatible devices */
 
 #define CONFIG_USBD_VENDORID 0x0525 	/* Linux/NetChip */
@@ -45,7 +45,7 @@
 
 #define CONFIG_USBD_CONFIGURATION_STR "TTY via USB"
 
-#define CONFIG_USBD_SERIAL_OUT_ENDPOINT UDC_OUT_ENDPOINT 
+#define CONFIG_USBD_SERIAL_OUT_ENDPOINT UDC_OUT_ENDPOINT
 #define CONFIG_USBD_SERIAL_OUT_PKTSIZE	UDC_OUT_PACKET_SIZE
 #define CONFIG_USBD_SERIAL_IN_ENDPOINT	UDC_IN_ENDPOINT
 #define CONFIG_USBD_SERIAL_IN_PKTSIZE	UDC_IN_PACKET_SIZE
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index c47306c..e8cb299 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -769,8 +769,6 @@
 #define UP2OCR		__REG(0x40600020)
 #define UP3OCR		__REG(0x40600024)
 
-
-
 /*
  * USB Host Controller
  */
diff --git a/include/configs/AdderUSB.h b/include/configs/AdderUSB.h
index 2112e56..a4f7f9a 100644
--- a/include/configs/AdderUSB.h
+++ b/include/configs/AdderUSB.h
@@ -3,7 +3,7 @@
  * Bryan O'Donoghue <bodonoghue@codehermit.ie>
  *
  * Provides support for USB console on the Analogue & Micro Adder87x
- * 
+ *
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -37,13 +37,13 @@
 
 /* If you have a USB-IF assigned VendorID then you may wish to define
  * your own vendor specific values either in BoardName.h or directly in
- * usbd_vendor_info.h 
+ * usbd_vendor_info.h
  */
 
-/* 
+/*
 #define CONFIG_USBD_MANUFACTURER	"CodeHermit.ie"
 #define CONFIG_USBD_PRODUCT_NAME	"Das U-Boot"
-#define CONFIG_USBD_VENDORID		0xFFFF 
+#define CONFIG_USBD_VENDORID		0xFFFF
 #define CONFIG_USBD_PRODUCTID_GSERIAL	0xFFFF
 #define CONFIG_USBD_PRODUCTID_CDCACM	0xFFFE
 */
diff --git a/include/usb_cdc_acm.h b/include/usb_cdc_acm.h
index 8cb1654..87bf50c 100644
--- a/include/usb_cdc_acm.h
+++ b/include/usb_cdc_acm.h
@@ -34,7 +34,7 @@
 #define ACM_RESPONSE_AVAILABLE		0x01
 #define ACM_SERIAL_STATE		0x20
 
-/* Format of response expected by a ACM_GET_LINE_ENCODING request */ 
+/* Format of response expected by a ACM_GET_LINE_ENCODING request */
 struct rs232_emu{
 		unsigned long dter;
 		unsigned char stop_bits;
diff --git a/include/usbdcore_mpc8xx.h b/include/usbdcore_mpc8xx.h
index e54acd9..9df62f4 100644
--- a/include/usbdcore_mpc8xx.h
+++ b/include/usbdcore_mpc8xx.h
@@ -99,7 +99,7 @@
 #define TX_BD_TO	0x04
 #define TX_BD_NO_PID	0x00
 #define TX_BD_PID_DATA0	0x80
-#define TX_BD_PID_DATA1	0xC0	
+#define TX_BD_PID_DATA1	0xC0
 #define TX_BD_CNF	0x200
 #define TX_BD_TC	0x400
 #define TX_BD_L		0x800
@@ -151,16 +151,16 @@
 	ushort usber;	/* Event Register */
 	ushort res3;	/* Reserved */
 	ushort usbmr;	/* Mask Register */
-	char res4;	/* Reserved */ 
+	char res4;	/* Reserved */
 	char usbs;	/* Status Register */
 	char res5[8];	/* Reserved */
 }usb_t;
 
 typedef struct mpc8xx_parameter_ram{
-	ushort ep0ptr;	/* Endpoint Pointer Register 0 */	
-	ushort ep1ptr;	/* Endpoint Pointer Register 1 */	
-	ushort ep2ptr;	/* Endpoint Pointer Register 2 */	
-	ushort ep3ptr;	/* Endpoint Pointer Register 3 */	
+	ushort ep0ptr;	/* Endpoint Pointer Register 0 */
+	ushort ep1ptr;	/* Endpoint Pointer Register 1 */
+	ushort ep2ptr;	/* Endpoint Pointer Register 2 */
+	ushort ep3ptr;	/* Endpoint Pointer Register 3 */
 	uint rstate;	/* Receive state */
 	uint rptr;	/* Receive internal data pointer */
 	ushort frame_n;	/* Frame number */
@@ -198,7 +198,7 @@
 void udc_irq(void);
 int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
 void udc_setup_ep(struct usb_device_instance *device, unsigned int ep,
-                  struct usb_endpoint_instance *endpoint);
+		  struct usb_endpoint_instance *endpoint);
 void udc_connect(void);
 void udc_disconnect(void);
 void udc_enable(struct usb_device_instance *device);
diff --git a/include/usbdescriptors.h b/include/usbdescriptors.h
index 8336c18..a752097 100644
--- a/include/usbdescriptors.h
+++ b/include/usbdescriptors.h
@@ -321,7 +321,7 @@
 	u8 bDescriptorType;
 	u8 bDescriptorSubtype;	/* 0x06 */
 	u8 bMasterInterface;
-	//u8 bSlaveInterface0[0];
+	/* u8 bSlaveInterface0[0]; */
 	u8 bSlaveInterface0;
 } __attribute__ ((packed));
 
