From 4b34297cfbf8b6d88a602898f0db05b5bf5bf8fd Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 10 Jun 2009 21:20:44 +0200 Subject: [PATCH] Get rid of remaining DEVICE_TYPE_* usage Signed-off-by: Sascha Hauer --- Documentation/devices_drivers.txt | 9 +-------- Documentation/porting.txt | 2 -- board/sandbox/hostfile.c | 2 -- commands/nand.c | 4 ---- drivers/nand/nand.c | 1 - include/driver.h | 21 ++------------------- 6 files changed, 3 insertions(+), 36 deletions(-) diff --git a/Documentation/devices_drivers.txt b/Documentation/devices_drivers.txt index 5a95c9173..06e788de8 100644 --- a/Documentation/devices_drivers.txt +++ b/Documentation/devices_drivers.txt @@ -26,17 +26,10 @@ char id[MAX_DRIVER_NAME]; The id is used to uniquely identify a device in the system. The id will show up under /dev/ as the device's name. Usually this is something like eth0 or nor0. -unsigned long type; - -This describes the type (or class) of this device. Have a look at include/driver.h -to see a list of known device types. Currently this includes DEVICE_TYPE_ETHER, -DEVICE_TYPE_CONSOLE and others. - void *type_data; Devices of a particular class normaly need to store more information than struct -device holds. This entry holds a pointer to the type specific struct, so a -a device of type DEVICE_TYPE_ETHER sets this to a struct eth_device. +device holds. This entry holds a pointer to the type specific struct. void *priv; diff --git a/Documentation/porting.txt b/Documentation/porting.txt index 93532a80c..d59925e5f 100644 --- a/Documentation/porting.txt +++ b/Documentation/porting.txt @@ -37,7 +37,6 @@ static struct device_d scb9328_serial_device = { .id = "cs0", .map_base = IMX_UART1_BASE, .size = 4096, - .type = DEVICE_TYPE_CONSOLE, }; static int scb9328_console_init(void) @@ -61,7 +60,6 @@ console_initcall(scb9328_console_init); Serial drivers - Declare all functions static. - - register a device of type DEVICE_TYPE_CONSOLE - in your probe function fill in a struct console_device and register it with console_register() diff --git a/board/sandbox/hostfile.c b/board/sandbox/hostfile.c index 652172220..b6f1dbd3d 100644 --- a/board/sandbox/hostfile.c +++ b/board/sandbox/hostfile.c @@ -64,7 +64,6 @@ static struct driver_d hf_drv = { .read = hf_read, .write = hf_write, .info = hf_info, - .type = DEVICE_TYPE_BLOCK, }; static int hf_init(void) @@ -88,7 +87,6 @@ int u_boot_register_filedev(struct hf_platform_data *hf, char *name_template) get_free_deviceid(dev->id, name_template); dev->size = hf->size; dev->map_base = hf->map_base; - dev->type = DEVICE_TYPE_BLOCK; return register_device(dev); } diff --git a/commands/nand.c b/commands/nand.c index 977644382..f7406fde4 100644 --- a/commands/nand.c +++ b/commands/nand.c @@ -272,10 +272,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int argc, char *argv[]) } dev = cdev->dev; - if (dev->type != DEVICE_TYPE_NAND_BB) { - printf("not a nand bb device: %s\n", dev); - return 1; - } bb = dev->priv; close(bb->fd); unregister_device(dev); diff --git a/drivers/nand/nand.c b/drivers/nand/nand.c index 5f5e83a84..f90a7ecec 100644 --- a/drivers/nand/nand.c +++ b/drivers/nand/nand.c @@ -160,7 +160,6 @@ static int nand_device_probe(struct device_d *dev) static struct driver_d nand_device_driver = { .name = "nand_device", .probe = nand_device_probe, - .type = DEVICE_TYPE_NAND, }; static int nand_init(void) diff --git a/include/driver.h b/include/driver.h index 98d54ad3a..80045183b 100644 --- a/include/driver.h +++ b/include/driver.h @@ -27,18 +27,6 @@ #define MAX_DRIVER_NAME 32 -#define DEVICE_TYPE_UNKNOWN 0 -#define DEVICE_TYPE_ETHER 1 -#define DEVICE_TYPE_CONSOLE 2 -#define DEVICE_TYPE_DRAM 3 -#define DEVICE_TYPE_BLOCK 4 -#define DEVICE_TYPE_FS 5 -#define DEVICE_TYPE_MIIPHY 6 -#define DEVICE_TYPE_NAND 7 -#define DEVICE_TYPE_NAND_BB 8 -#define DEVICE_TYPE_PARTITION 9 -#define MAX_DEVICE_TYPE 9 - #include /** @@ -91,9 +79,8 @@ struct device_d { void *platform_data; /*! board specific information about this device */ /*! Devices of a particular class normaly need to store more - * information than struct device holds. This entry holds a pointer to - * the type specific struct, so a a device of type DEVICE_TYPE_ETHER - * sets this to a struct eth_device. */ + * information than struct device holds. + */ void *priv; void *type_data; /*! In case this device is a specific device, this pointer * points to the type specific device, i.e. eth_device @@ -107,11 +94,7 @@ struct device_d { struct device_d *parent; /* our parent, NULL if not present */ - /*! This describes the type (or class) of this device. Have a look at - * include/driver.h to see a list of known device types. Currently this - * includes DEVICE_TYPE_ETHER, DEVICE_TYPE_CONSOLE and others. */ struct bus_type *bus; - unsigned long type; /*! The parameters for this device. This is used to carry information * of board specific data from the board code to the device driver. */