diff options
| author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2008-08-31 04:24:55 +0200 | 
|---|---|---|
| committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2008-08-31 04:24:55 +0200 | 
| commit | c1de7a6daf9c657484e1c6d433f01fccd49a7f48 (patch) | |
| tree | 7d73ef79e8208b3ac21de13a4a4e968dbf0e6e19 /common/usb_kbd.c | |
| parent | ef0255fc75f28655f9681422079287d68a14dbaa (diff) | |
| download | olio-uboot-2014.01-c1de7a6daf9c657484e1c6d433f01fccd49a7f48.tar.xz olio-uboot-2014.01-c1de7a6daf9c657484e1c6d433f01fccd49a7f48.zip | |
devices: merge to list_head
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'common/usb_kbd.c')
| -rw-r--r-- | common/usb_kbd.c | 14 | 
1 files changed, 6 insertions, 8 deletions
| diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 04d9730e6..108bd60f9 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -152,7 +152,7 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum);  /* search for keyboard and register it if found */  int drv_usb_kbd_init(void)  { -	int error,i,index; +	int error,i;  	device_t usb_kbd_dev,*old_dev;  	struct usb_device *dev;  	char *stdinname  = getenv ("stdin"); @@ -166,13 +166,11 @@ int drv_usb_kbd_init(void)  			if(usb_kbd_probe(dev,0)==1) { /* Ok, we found a keyboard */  				/* check, if it is already registered */  				USB_KBD_PRINTF("USB KBD found set up device.\n"); -				for (index=1; index<=ListNumItems(devlist); index++) { -					old_dev = ListGetPtrToItem(devlist, index); -					if(strcmp(old_dev->name,DEVNAME)==0) { -						/* ok, already registered, just return ok */ -						USB_KBD_PRINTF("USB KBD is already registered.\n"); -						return 1; -					} +				old_dev = device_get_by_name(DEVNAME); +				if(old_dev) { +					/* ok, already registered, just return ok */ +					USB_KBD_PRINTF("USB KBD is already registered.\n"); +					return 1;  				}  				/* register the keyboard */  				USB_KBD_PRINTF("USB KBD register.\n"); |