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>
diff --git a/drivers/serial/arm_dcc.c b/drivers/serial/arm_dcc.c
index dca73b9..7b5ecb5 100644
--- a/drivers/serial/arm_dcc.c
+++ b/drivers/serial/arm_dcc.c
@@ -27,7 +27,7 @@
*/
#include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
#if defined(CONFIG_CPU_V6)
/*
@@ -148,7 +148,7 @@
}
#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 @@
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 f711d0b..cffd5a2 100644
--- a/drivers/serial/usbtty.c
+++ b/drivers/serial/usbtty.c
@@ -24,7 +24,7 @@
#include <common.h>
#include <config.h>
#include <circbuf.h>
-#include <devices.h>
+#include <stdio_dev.h>
#include "usbtty.h"
#include "usb_cdc_acm.h"
#include "usbdescriptors.h"
@@ -70,7 +70,7 @@
/*
* 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 @@
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;
}