mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 00:32:04 +02:00
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>
This commit is contained in:
committed by
Wolfgang Denk
parent
f732a7598f
commit
52cb4d4fb3
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user