kernel/eka/drivers/usbcc/ps_usbc.cpp
branchRCL_3
changeset 21 e7d2d738d3c2
parent 19 4a8fed1c0ef6
child 22 2f92ad2dc5db
--- a/kernel/eka/drivers/usbcc/ps_usbc.cpp	Fri Mar 12 15:50:11 2010 +0200
+++ b/kernel/eka/drivers/usbcc/ps_usbc.cpp	Mon Mar 15 12:45:50 2010 +0200
@@ -180,11 +180,13 @@
 		}
 	DeActivateHardwareController();					 // turn off UDC altogether
 	iStackIsActive = EFalse;
+	// Notify registered clients on the user side about a USB device state
+	// change event and a transition to the "Undefined" state.
+	// Note: the state should be changed to "Undefined" before calling RunClientCallbacks(), 
+	//       otherwise the "Undefined" state will probably be lost.
+	NextDeviceState(EUsbcDeviceStateUndefined);
 	// Complete all pending requests, returning KErrDisconnected
 	RunClientCallbacks();
-	// Notify registered clients on the user side about a USB device state
-	// change event and a transition to the "Undefined" state.
-	NextDeviceState(EUsbcDeviceStateUndefined);
 	}