From 52cb4d4fb3487313f5a72ea740f527a4aefaa365 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 16 May 2009 12:14:54 +0200 Subject: 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 Edited commit message. Signed-off-by: Wolfgang Denk --- drivers/input/keyboard.c | 6 +++--- drivers/net/netconsole.c | 6 +++--- drivers/serial/arm_dcc.c | 6 +++--- drivers/serial/usbtty.c | 6 +++--- drivers/usb/musb/musb_hcd.c | 4 ++-- drivers/usb/musb/musb_hcd.h | 2 +- drivers/video/cfb_console.c | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) (limited to 'drivers') diff --git a/drivers/input/keyboard.c b/drivers/input/keyboard.c index 512b9f28c..a5fbd5f50 100644 --- a/drivers/input/keyboard.c +++ b/drivers/input/keyboard.c @@ -11,7 +11,7 @@ #include -#include +#include #include #undef KBG_DEBUG @@ -268,7 +268,7 @@ extern int overwrite_console (void); int kbd_init (void) { int error; - device_t kbddev ; + struct stdio_dev kbddev ; char *stdinname = getenv ("stdin"); if(kbd_init_hw()==-1) @@ -281,7 +281,7 @@ int kbd_init (void) kbddev.getc = kbd_getc ; kbddev.tstc = kbd_testc ; - error = device_register (&kbddev); + error = stdio_register (&kbddev); if(error==0) { /* check if this is the standard input device */ if(strcmp(stdinname,DEVNAME)==0) { diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index b2ee5eaba..f5329a594 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -23,7 +23,7 @@ #include #include -#include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -243,7 +243,7 @@ int nc_tstc (void) int drv_nc_init (void) { - device_t dev; + struct stdio_dev dev; int rc; memset (&dev, 0, sizeof (dev)); @@ -256,7 +256,7 @@ int drv_nc_init (void) dev.getc = nc_getc; dev.tstc = nc_tstc; - rc = device_register (&dev); + rc = stdio_register (&dev); return (rc == 0) ? 1 : rc; } diff --git a/drivers/serial/arm_dcc.c b/drivers/serial/arm_dcc.c index dca73b93d..7b5ecb513 100644 --- a/drivers/serial/arm_dcc.c +++ b/drivers/serial/arm_dcc.c @@ -27,7 +27,7 @@ */ #include -#include +#include #if defined(CONFIG_CPU_V6) /* @@ -148,7 +148,7 @@ int arm_dcc_tstc(void) } #ifdef CONFIG_ARM_DCC_MULTI -static device_t arm_dcc_dev; +static struct stdio_dev arm_dcc_dev; int drv_arm_dcc_init(void) { @@ -165,6 +165,6 @@ int drv_arm_dcc_init(void) arm_dcc_dev.putc = arm_dcc_putc; /* 'putc' function */ arm_dcc_dev.puts = arm_dcc_puts; /* 'puts' function */ - return device_register(&arm_dcc_dev); + return stdio_register(&arm_dcc_dev); } #endif diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c index f711d0b18..cffd5a2b2 100644 --- a/drivers/serial/usbtty.c +++ b/drivers/serial/usbtty.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "usbtty.h" #include "usb_cdc_acm.h" #include "usbdescriptors.h" @@ -70,7 +70,7 @@ static circbuf_t usbtty_output; /* * Instance variables */ -static device_t usbttydev; +static struct stdio_dev usbttydev; static struct usb_device_instance device_instance[1]; static struct usb_bus_instance bus_instance[1]; static struct usb_configuration_instance config_instance[NUM_CONFIGS]; @@ -570,7 +570,7 @@ int drv_usbtty_init (void) usbttydev.putc = usbtty_putc; /* 'putc' function */ usbttydev.puts = usbtty_puts; /* 'puts' function */ - rc = device_register (&usbttydev); + rc = stdio_register (&usbttydev); return (rc == 0) ? 1 : rc; } diff --git a/drivers/usb/musb/musb_hcd.c b/drivers/usb/musb/musb_hcd.c index 19d978b24..4ca94cb31 100644 --- a/drivers/usb/musb/musb_hcd.c +++ b/drivers/usb/musb/musb_hcd.c @@ -801,7 +801,7 @@ int submit_int_msg(struct usb_device *dev, unsigned long pipe, */ void usb_event_poll() { - device_t *dev; + struct stdio_dev *dev; struct usb_device *usb_kbd_dev; struct usb_interface_descriptor *iface; struct usb_endpoint_descriptor *ep; @@ -809,7 +809,7 @@ void usb_event_poll() int maxp; /* Get the pointer to USB Keyboard device pointer */ - dev = device_get_by_name("usbkbd"); + dev = stdio_get_by_name("usbkbd"); usb_kbd_dev = (struct usb_device *)dev->priv; iface = &usb_kbd_dev->config.if_desc[0]; ep = &iface->ep_desc[0]; diff --git a/drivers/usb/musb/musb_hcd.h b/drivers/usb/musb/musb_hcd.h index b7f571d03..17e9091a0 100644 --- a/drivers/usb/musb/musb_hcd.h +++ b/drivers/usb/musb/musb_hcd.h @@ -26,7 +26,7 @@ #include "musb_core.h" #ifdef CONFIG_USB_KEYBOARD -#include +#include extern unsigned char new[]; #endif diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 6adce1998..fbc4df9f6 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -183,7 +183,7 @@ CONFIG_VIDEO_HW_CURSOR: - Uses the hardware cursor capability of the #include #include -#include +#include #include #if defined(CONFIG_CMD_DATE) @@ -1378,7 +1378,7 @@ int board_video_skip(void) __attribute__((weak, alias("__board_video_skip"))); int drv_video_init (void) { int skip_dev_init; - device_t console_dev; + struct stdio_dev console_dev; /* Check if video initialization should be skipped */ if (board_video_skip()) @@ -1412,7 +1412,7 @@ int drv_video_init (void) console_dev.getc = VIDEO_GETC_FCT; /* 'getc' function */ #endif /* CONFIG_VGA_AS_SINGLE_DEVICE */ - if (device_register (&console_dev) != 0) + if (stdio_register (&console_dev) != 0) return 0; /* Return success */ -- cgit v1.2.3