diff options
author | Peter D'Hoye <peter.dhoye@gmail.com> | 2007-09-17 20:49:02 +0000 |
---|---|---|
committer | Peter D'Hoye <peter.dhoye@gmail.com> | 2007-09-17 20:49:02 +0000 |
commit | b0c996ba92713e06ff28e610e7bebab8a065b68e (patch) | |
tree | 8854e3a4fd5a054ecadb50a654297bad1da30c79 /firmware/usbstack/core/core.c | |
parent | 5011d43d13f4a5964fd6fe7b62d0fa2577d5edf9 (diff) | |
download | rockbox-b0c996ba92713e06ff28e610e7bebab8a065b68e.tar.gz rockbox-b0c996ba92713e06ff28e610e7bebab8a065b68e.zip |
code police, no functional changes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14737 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usbstack/core/core.c')
-rw-r--r-- | firmware/usbstack/core/core.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/firmware/usbstack/core/core.c b/firmware/usbstack/core/core.c index 2fbec5d571..0d2cfc67b9 100644 --- a/firmware/usbstack/core/core.c +++ b/firmware/usbstack/core/core.c | |||
@@ -99,7 +99,8 @@ void usb_stack_start(void) | |||
99 | * and if it has a device driver bind to it */ | 99 | * and if it has a device driver bind to it */ |
100 | logf("check for auto bind"); | 100 | logf("check for auto bind"); |
101 | if (usbcore.active_controller->type == DEVICE) { | 101 | if (usbcore.active_controller->type == DEVICE) { |
102 | if (usbcore.active_controller->device_driver == NULL && usbcore.device_driver != NULL) { | 102 | if (usbcore.active_controller->device_driver == NULL && |
103 | usbcore.device_driver != NULL) { | ||
103 | /* bind driver */ | 104 | /* bind driver */ |
104 | logf("binding..."); | 105 | logf("binding..."); |
105 | bind_device_driver(usbcore.device_driver); | 106 | bind_device_driver(usbcore.device_driver); |
@@ -130,7 +131,8 @@ void usb_stack_stop(void) | |||
130 | void usb_stack_irq(void) | 131 | void usb_stack_irq(void) |
131 | { | 132 | { |
132 | /* simply notify usb controller */ | 133 | /* simply notify usb controller */ |
133 | if (usbcore.active_controller != NULL && usbcore.active_controller->irq != NULL) { | 134 | if (usbcore.active_controller != NULL && |
135 | usbcore.active_controller->irq != NULL) { | ||
134 | usbcore.active_controller->irq(); | 136 | usbcore.active_controller->irq(); |
135 | } | 137 | } |
136 | } | 138 | } |
@@ -190,7 +192,8 @@ int usb_controller_register(struct usb_controller* ctrl) | |||
190 | * @param ctrl pointer to controller to unregister. | 192 | * @param ctrl pointer to controller to unregister. |
191 | * @return 0 on success else a defined error code. | 193 | * @return 0 on success else a defined error code. |
192 | */ | 194 | */ |
193 | int usb_controller_unregister(struct usb_controller* ctrl) { | 195 | int usb_controller_unregister(struct usb_controller* ctrl) |
196 | { | ||
194 | 197 | ||
195 | if (ctrl == NULL) { | 198 | if (ctrl == NULL) { |
196 | return EINVAL; | 199 | return EINVAL; |
@@ -226,7 +229,8 @@ void usb_controller_select(int type) | |||
226 | struct usb_controller* new = NULL; | 229 | struct usb_controller* new = NULL; |
227 | 230 | ||
228 | /* check if a controller of the wanted type is already loaded */ | 231 | /* check if a controller of the wanted type is already loaded */ |
229 | if (usbcore.active_controller != NULL && (int)usbcore.active_controller->type == type) { | 232 | if (usbcore.active_controller != NULL && |
233 | (int)usbcore.active_controller->type == type) { | ||
230 | logf("controller already set"); | 234 | logf("controller already set"); |
231 | return; | 235 | return; |
232 | } | 236 | } |
@@ -263,7 +267,8 @@ void usb_controller_select(int type) | |||
263 | usbcore.active_controller->init(); | 267 | usbcore.active_controller->init(); |
264 | } | 268 | } |
265 | 269 | ||
266 | int usb_stack_get_mode(void) { | 270 | int usb_stack_get_mode(void) |
271 | { | ||
267 | return usbcore.mode; | 272 | return usbcore.mode; |
268 | } | 273 | } |
269 | 274 | ||
@@ -296,8 +301,8 @@ int usb_device_driver_register(struct usb_device_driver* driver) | |||
296 | return 0; | 301 | return 0; |
297 | } | 302 | } |
298 | 303 | ||
299 | int usb_device_driver_bind(const char* name) { | 304 | int usb_device_driver_bind(const char* name) |
300 | 305 | { | |
301 | int i; | 306 | int i; |
302 | struct usb_device_driver *tmp = NULL; | 307 | struct usb_device_driver *tmp = NULL; |
303 | struct usb_device_driver *driver = NULL; | 308 | struct usb_device_driver *driver = NULL; |
@@ -340,8 +345,8 @@ int usb_device_driver_bind(const char* name) { | |||
340 | return 0; | 345 | return 0; |
341 | } | 346 | } |
342 | 347 | ||
343 | void usb_device_driver_unbind(void) { | 348 | void usb_device_driver_unbind(void) |
344 | 349 | { | |
345 | logf("usb_device_driver_unbind"); | 350 | logf("usb_device_driver_unbind"); |
346 | if (usbcore.active_controller->device_driver != NULL) { | 351 | if (usbcore.active_controller->device_driver != NULL) { |
347 | usbcore.active_controller->device_driver->unbind(); | 352 | usbcore.active_controller->device_driver->unbind(); |
@@ -351,8 +356,8 @@ void usb_device_driver_unbind(void) { | |||
351 | usbcore.device_driver = NULL; | 356 | usbcore.device_driver = NULL; |
352 | } | 357 | } |
353 | 358 | ||
354 | static void update_driver_names(unsigned char* result) { | 359 | static void update_driver_names(unsigned char* result) |
355 | 360 | { | |
356 | int i; | 361 | int i; |
357 | int pos = 0; | 362 | int pos = 0; |
358 | unsigned char terminator = ','; | 363 | unsigned char terminator = ','; |
@@ -376,8 +381,8 @@ static void update_driver_names(unsigned char* result) { | |||
376 | } | 381 | } |
377 | } | 382 | } |
378 | 383 | ||
379 | static void bind_device_driver(struct usb_device_driver* driver) { | 384 | static void bind_device_driver(struct usb_device_driver* driver) |
380 | 385 | { | |
381 | int ret = 0; | 386 | int ret = 0; |
382 | 387 | ||
383 | /* look if there is an old driver */ | 388 | /* look if there is an old driver */ |