aboutsummaryrefslogtreecommitdiff
path: root/common/iomux.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD2009-05-16 12:14:54 +0200
committerWolfgang Denk2009-07-18 00:27:46 +0200
commit52cb4d4fb3487313f5a72ea740f527a4aefaa365 (patch)
treee673bea782668009ec4818c16b159d7cf1b062ba /common/iomux.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/iomux.c')
-rw-r--r--common/iomux.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/iomux.c b/common/iomux.c
index bdcc853ff07..91d98e98358 100644
--- a/common/iomux.c
+++ b/common/iomux.c
@@ -29,7 +29,7 @@
void iomux_printdevs(const int console)
{
int i;
- device_t *dev;
+ struct stdio_dev *dev;
for (i = 0; i < cd_count[console]; i++) {
dev = console_devices[console][i];
@@ -43,8 +43,8 @@ int iomux_doenv(const int console, const char *arg)
{
char *console_args, *temp, **start;
int i, j, k, io_flag, cs_idx, repeat;
- device_t *dev;
- device_t **cons_set;
+ struct stdio_dev *dev;
+ struct stdio_dev **cons_set;
console_args = strdup(arg);
if (console_args == NULL)
@@ -85,7 +85,7 @@ int iomux_doenv(const int console, const char *arg)
*temp = '\0';
start[i] = temp + 1;
}
- cons_set = (device_t **)calloc(i, sizeof(device_t *));
+ cons_set = (struct stdio_dev **)calloc(i, sizeof(struct stdio_dev *));
if (cons_set == NULL) {
free(start);
free(console_args);
@@ -158,14 +158,14 @@ int iomux_doenv(const int console, const char *arg)
} else {
/* Works even if console_devices[console] is NULL. */
console_devices[console] =
- (device_t **)realloc(console_devices[console],
- cs_idx * sizeof(device_t *));
+ (struct stdio_dev **)realloc(console_devices[console],
+ cs_idx * sizeof(struct stdio_dev *));
if (console_devices[console] == NULL) {
free(cons_set);
return 1;
}
memcpy(console_devices[console], cons_set, cs_idx *
- sizeof(device_t *));
+ sizeof(struct stdio_dev *));
cd_count[console] = cs_idx;
}