aboutsummaryrefslogtreecommitdiff
path: root/common/usb_kbd.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2009-05-16 12:14:54 +0200
committerWolfgang Denk <wd@denx.de>2009-07-18 00:27:46 +0200
commit52cb4d4fb3487313f5a72ea740f527a4aefaa365 (patch)
treee673bea782668009ec4818c16b159d7cf1b062ba /common/usb_kbd.c
parentf732a7598fa36d48241df20b1a1f4cdbf09f75ee (diff)
stdio/device: rework function naming convention
So far the console API uses the following naming convention: ======Extract====== typedef struct device_t; int device_register (device_t * dev); int devices_init (void); int device_deregister(char *devname); struct list_head* device_get_list(void); device_t* device_get_by_name(char* name); device_t* device_clone(device_t *dev); ======= which is too generic and confusing. Instead of using device_XX and device_t we change this into stdio_XX and stdio_dev This will also allow to add later a generic device mechanism in order to have support for multiple devices and driver instances. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Edited commit message. Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'common/usb_kbd.c')
-rw-r--r--common/usb_kbd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index e0d006c32..b458d7728 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -25,7 +25,7 @@
*
*/
#include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include <asm/byteorder.h>
#include <usb.h>
@@ -153,7 +153,7 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum);
int drv_usb_kbd_init(void)
{
int error,i;
- device_t usb_kbd_dev,*old_dev;
+ struct stdio_dev usb_kbd_dev,*old_dev;
struct usb_device *dev;
char *stdinname = getenv ("stdin");
@@ -168,7 +168,7 @@ 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");
- old_dev = device_get_by_name(DEVNAME);
+ old_dev = stdio_get_by_name(DEVNAME);
if(old_dev) {
/* ok, already registered, just return ok */
USB_KBD_PRINTF("USB KBD is already registered.\n");
@@ -176,7 +176,7 @@ int drv_usb_kbd_init(void)
}
/* register the keyboard */
USB_KBD_PRINTF("USB KBD register.\n");
- memset (&usb_kbd_dev, 0, sizeof(device_t));
+ memset (&usb_kbd_dev, 0, sizeof(struct stdio_dev));
strcpy(usb_kbd_dev.name, DEVNAME);
usb_kbd_dev.flags = DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
usb_kbd_dev.putc = NULL;
@@ -184,7 +184,7 @@ int drv_usb_kbd_init(void)
usb_kbd_dev.getc = usb_kbd_getc;
usb_kbd_dev.tstc = usb_kbd_testc;
usb_kbd_dev.priv = (void *)dev;
- error = device_register (&usb_kbd_dev);
+ error = stdio_register (&usb_kbd_dev);
if(error==0) {
/* check if this is the standard input device */
if(strcmp(stdinname,DEVNAME)==0) {
@@ -212,8 +212,8 @@ int drv_usb_kbd_init(void)
/* deregistering the keyboard */
int usb_kbd_deregister(void)
{
-#ifdef CONFIG_SYS_DEVICE_DEREGISTER
- return device_deregister(DEVNAME);
+#ifdef CONFIG_SYS_STDIO_DEREGISTER
+ return stdio_deregister(DEVNAME);
#else
return 1;
#endif