diff options
author | Aaron Durbin <adurbin@chromium.org> | 2017-08-07 16:55:43 -0600 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2017-08-09 17:47:18 +0000 |
commit | c30d913f1f76cbde79039b7865939182c0d7c37a (patch) | |
tree | e048c5e27424dea8d8490167415adaab941dd78a /src/include/device/device.h | |
parent | e9787ff61f81054bfd0c3e3ad214484e1bdf4db3 (diff) | |
download | coreboot-c30d913f1f76cbde79039b7865939182c0d7c37a.tar.xz |
device/pci: untangle struct device and device_t
This patch uses struct device explicitly for the ramstage functions
as that's the actual type it's working on. Additionally, the
declarations for types and functions are fully exposed so that
compliation units don't have to guard certain functions from use
because it's being compiled for multiple stages.
Change-Id: I8db23ed400a59073e1e66522d020a5928f71f3a6
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/20902
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/include/device/device.h')
-rw-r--r-- | src/include/device/device.h | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h index 242d29762c..54d4ec314f 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -18,6 +18,8 @@ struct device; #ifndef __SIMPLE_DEVICE__ typedef struct device *device_t; +#endif + struct pci_operations; struct pci_bus_operations; struct i2c_bus_operations; @@ -43,33 +45,33 @@ struct smbios_type11; struct acpi_rsdp; struct device_operations { - void (*read_resources)(device_t dev); - void (*set_resources)(device_t dev); - void (*enable_resources)(device_t dev); - void (*init)(device_t dev); - void (*final)(device_t dev); - void (*scan_bus)(device_t bus); - void (*enable)(device_t dev); - void (*disable)(device_t dev); - void (*set_link)(device_t dev, unsigned int link); + void (*read_resources)(struct device *dev); + void (*set_resources)(struct device *dev); + void (*enable_resources)(struct device *dev); + void (*init)(struct device *dev); + void (*final)(struct device *dev); + void (*scan_bus)(struct device *bus); + void (*enable)(struct device *dev); + void (*disable)(struct device *dev); + void (*set_link)(struct device *dev, unsigned int link); void (*reset_bus)(struct bus *bus); #if IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES) - int (*get_smbios_data)(device_t dev, int *handle, + int (*get_smbios_data)(struct device *dev, int *handle, unsigned long *current); - void (*get_smbios_strings)(device_t dev, struct smbios_type11 *t); + void (*get_smbios_strings)(struct device *dev, struct smbios_type11 *t); #endif #if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES) - unsigned long (*write_acpi_tables)(device_t dev, unsigned long start, - struct acpi_rsdp *rsdp); - void (*acpi_fill_ssdt_generator)(device_t dev); - void (*acpi_inject_dsdt_generator)(device_t dev); - const char *(*acpi_name)(device_t dev); + unsigned long (*write_acpi_tables)(struct device *dev, + unsigned long start, struct acpi_rsdp *rsdp); + void (*acpi_fill_ssdt_generator)(struct device *dev); + void (*acpi_inject_dsdt_generator)(struct device *dev); + const char *(*acpi_name)(struct device *dev); #endif const struct pci_operations *ops_pci; const struct i2c_bus_operations *ops_i2c_bus; const struct spi_bus_operations *ops_spi_bus; const struct smbus_bus_operations *ops_smbus_bus; - const struct pci_bus_operations * (*ops_pci_bus)(device_t dev); + const struct pci_bus_operations * (*ops_pci_bus)(struct device *dev); const struct pnp_mode_ops *ops_pnp_mode; }; @@ -79,9 +81,6 @@ struct device_operations { static inline void device_noop(struct device *dev) {} #define DEVICE_NOOP device_noop -#endif /* ! __SIMPLE_DEVICE__ */ - - struct bus { DEVTREE_CONST struct device *dev; /* This bridge device */ |