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 --- common/iomux.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'common/iomux.c') diff --git a/common/iomux.c b/common/iomux.c index bdcc853ff0..91d98e9835 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; } -- cgit