diff --git a/device/agp_device.c b/device/agp_device.c index 9da262973a..2d73b4db6a 100644 --- a/device/agp_device.c +++ b/device/agp_device.c @@ -24,7 +24,7 @@ #include #include -static void agp_tune_dev(device_t dev) +static void agp_tune_dev(struct device *dev) { unsigned int cap; cap = pci_find_capability(dev, PCI_CAP_ID_AGP); @@ -37,7 +37,7 @@ static void agp_tune_dev(device_t dev) unsigned int agp_scan_bus(struct bus *bus, unsigned int min_devfn, unsigned int max_devfn, unsigned int max) { - device_t child; + struct device *child; max = pci_scan_bus(bus, min_devfn, max_devfn, max); for (child = bus->children; child; child = child->sibling) { if ((child->path.u.pci.devfn < min_devfn) || @@ -49,7 +49,7 @@ unsigned int agp_scan_bus(struct bus *bus, unsigned int min_devfn, return max; } -unsigned int agp_scan_bridge(device_t dev, unsigned int max) +unsigned int agp_scan_bridge(struct device *dev, unsigned int max) { return do_pci_scan_bridge(dev, max, agp_scan_bus); } diff --git a/device/cardbus_device.c b/device/cardbus_device.c index 06144deb3a..d975a9c868 100644 --- a/device/cardbus_device.c +++ b/device/cardbus_device.c @@ -37,7 +37,7 @@ #define CARDBUS_IO_SIZE (4096) #define CARDBUS_MEM_SIZE (32*1024*1024) -static void cardbus_record_bridge_resource(device_t dev, resource_t moving, +static void cardbus_record_bridge_resource(struct device *dev, resource_t moving, resource_t min_size, unsigned int index, unsigned long type) { @@ -70,7 +70,8 @@ static void cardbus_record_bridge_resource(device_t dev, resource_t moving, return; } -static void cardbus_size_bridge_resource(device_t dev, unsigned int index) +static void cardbus_size_bridge_resource(struct device *dev, + unsigned int index) { struct resource *resource; resource_t min_size; @@ -88,7 +89,7 @@ static void cardbus_size_bridge_resource(device_t dev, unsigned int index) } } -void cardbus_read_resources(device_t dev) +void cardbus_read_resources(struct device *dev) { resource_t moving_base, moving_limit, moving; unsigned long type; @@ -157,7 +158,7 @@ void cardbus_read_resources(device_t dev) compact_resources(dev); } -void cardbus_enable_resources(device_t dev) +void cardbus_enable_resources(struct device *dev) { u16 ctrl; ctrl = pci_read_config16(dev, PCI_CB_BRIDGE_CONTROL); @@ -185,7 +186,7 @@ unsigned int cardbus_scan_bus(struct bus *bus, unsigned int min_devfn, return pci_scan_bus(bus, min_devfn, max_devfn, max); } -unsigned int cardbus_scan_bridge(device_t dev, unsigned int max) +unsigned int cardbus_scan_bridge(struct device *dev, unsigned int max) { struct bus *bus; u32 buses; diff --git a/device/hypertransport.c b/device/hypertransport.c index 1c833ec1cc..d7b65c7718 100644 --- a/device/hypertransport.c +++ b/device/hypertransport.c @@ -39,9 +39,9 @@ #include #endif -static device_t ht_scan_get_devs(device_t *old_devices) +static struct device *ht_scan_get_devs(struct device **old_devices) { - device_t first, last; + struct device *first, *last; first = *old_devices; last = first; @@ -54,7 +54,7 @@ static device_t ht_scan_get_devs(device_t *old_devices) last = last->sibling; } if (first) { - device_t child; + struct device *child; /* Unlink the chain from the list of old devices. */ *old_devices = last->sibling; last->sibling = 0; @@ -75,7 +75,7 @@ static device_t ht_scan_get_devs(device_t *old_devices) } #if OPT_HT_LINK == 1 -static unsigned ht_read_freq_cap(device_t dev, unsigned pos) +static unsigned ht_read_freq_cap(struct device *dev, unsigned pos) { /* Handle bugs in valid hypertransport frequency reporting. */ unsigned freq_cap; @@ -116,7 +116,8 @@ struct ht_link { unsigned char ctrl_off, config_off, freq_off, freq_cap_off; }; -static int ht_setup_link(struct ht_link *prev, device_t dev, unsigned int pos) +static int ht_setup_link(struct ht_link *prev, struct device *dev, + unsigned int pos) { static const u8 link_width_to_pow2[] = { 3, 4, 0, 5, 1, 2, 0, 0 }; static const u8 pow2_to_link_width[] = { 0x7, 4, 5, 0, 1, 3 }; @@ -399,10 +400,10 @@ unsigned int hypertransport_scan_chain(struct bus *bus, unsigned int min_devfn, * optimize link. */ unsigned int next_unitid, last_unitid; - device_t old_devices, dev, func; + struct device *old_devices, *dev, *func; unsigned int min_unitid = (offset_unitid) ? HT_CHAIN_UNITID_BASE : 1; struct ht_link prev; - device_t last_func = 0; + struct device *last_func = 0; int ht_dev_num = 0; #if HT_CHAIN_END_UNITID_BASE < HT_CHAIN_UNITID_BASE @@ -411,7 +412,7 @@ unsigned int hypertransport_scan_chain(struct bus *bus, unsigned int min_devfn, */ unsigned int real_last_unitid; u8 real_last_pos; - device_t real_last_dev; + struct device *real_last_dev; #endif /* Restore the hypertransport chain to its unitialized state. */ @@ -554,7 +555,7 @@ unsigned int hypertransport_scan_chain(struct bus *bus, unsigned int min_devfn, if (offset_unitid && (ht_dev_num > 0)) { u16 flags; int i; - device_t last_func = 0; + struct device *last_func = 0; flags = pci_read_config16(real_last_dev, real_last_pos + PCI_CAP_FLAGS); flags &= ~0x1f; @@ -585,7 +586,7 @@ unsigned int hypertransport_scan_chain(struct bus *bus, unsigned int min_devfn, * TODO: No more Config.lb in LinuxBIOSv3. */ if (old_devices) { - device_t left; + struct device *left; for (left = old_devices; left; left = left->sibling) { printk_debug("%s\n", dev_path(left)); } diff --git a/device/pciexp_device.c b/device/pciexp_device.c index 574372c5d5..3025b4b3a1 100644 --- a/device/pciexp_device.c +++ b/device/pciexp_device.c @@ -24,7 +24,7 @@ #include #include -static void pciexp_tune_dev(device_t dev) +static void pciexp_tune_dev(struct device *dev) { unsigned int cap; cap = pci_find_capability(dev, PCI_CAP_ID_PCIE); @@ -39,7 +39,7 @@ static void pciexp_tune_dev(device_t dev) unsigned int pciexp_scan_bus(struct bus *bus, unsigned int min_devfn, unsigned int max_devfn, unsigned int max) { - device_t child; + struct device *child; max = pci_scan_bus(bus, min_devfn, max_devfn, max); for (child = bus->children; child; child = child->sibling) { if ((child->path.u.pci.devfn < min_devfn) || @@ -51,7 +51,7 @@ unsigned int pciexp_scan_bus(struct bus *bus, unsigned int min_devfn, return max; } -unsigned int pciexp_scan_bridge(device_t dev, unsigned int max) +unsigned int pciexp_scan_bridge(struct device *dev, unsigned int max) { return do_pci_scan_bridge(dev, max, pciexp_scan_bus); } diff --git a/device/pcix_device.c b/device/pcix_device.c index 635b9db246..65da8316b9 100644 --- a/device/pcix_device.c +++ b/device/pcix_device.c @@ -24,7 +24,7 @@ #include #include -static void pcix_tune_dev(device_t dev) +static void pcix_tune_dev(struct device *dev) { unsigned int cap; unsigned int status, orig_cmd, cmd; @@ -63,7 +63,7 @@ static void pcix_tune_dev(device_t dev) unsigned int pcix_scan_bus(struct bus *bus, unsigned int min_devfn, unsigned int max_devfn, unsigned int max) { - device_t child; + struct device *child; max = pci_scan_bus(bus, min_devfn, max_devfn, max); for (child = bus->children; child; child = child->sibling) { if ((child->path.u.pci.devfn < min_devfn) || @@ -114,7 +114,7 @@ const char *pcix_speed(unsigned int sstatus) return result; } -unsigned int pcix_scan_bridge(device_t dev, unsigned int max) +unsigned int pcix_scan_bridge(struct device *dev, unsigned int max) { unsigned int pos, status; diff --git a/device/smbus_ops.c b/device/smbus_ops.c index a90639aff1..010040ddf8 100644 --- a/device/smbus_ops.c +++ b/device/smbus_ops.c @@ -25,7 +25,7 @@ #include #include -struct bus *get_pbus_smbus(device_t dev) +struct bus *get_pbus_smbus(struct device *dev) { struct bus *pbus = dev->bus; while (pbus && pbus->dev && !ops_smbus_bus(pbus)) { @@ -46,7 +46,7 @@ struct bus *get_pbus_smbus(device_t dev) * 1 store get_pbus_smbus list link * 2 reverse the link and call set link */ -int smbus_set_link(device_t dev) +int smbus_set_link(struct device *dev) { struct bus *pbus_a[4]; // 4 level mux only. Enough? struct bus *pbus = dev->bus; @@ -71,57 +71,57 @@ int smbus_set_link(device_t dev) return pbus_num; } -int smbus_quick_read(device_t dev) +int smbus_quick_read(struct device *dev) { return ops_smbus_bus(get_pbus_smbus(dev))->quick_read(dev); } -int smbus_quick_write(device_t dev) +int smbus_quick_write(struct device *dev) { return ops_smbus_bus(get_pbus_smbus(dev))->quick_write(dev); } -int smbus_recv_byte(device_t dev) +int smbus_recv_byte(struct device *dev) { return ops_smbus_bus(get_pbus_smbus(dev))->recv_byte(dev); } -int smbus_send_byte(device_t dev, u8 byte) +int smbus_send_byte(struct device *dev, u8 byte) { return ops_smbus_bus(get_pbus_smbus(dev))->send_byte(dev, byte); } -int smbus_read_byte(device_t dev, u8 addr) +int smbus_read_byte(struct device *dev, u8 addr) { return ops_smbus_bus(get_pbus_smbus(dev))->read_byte(dev, addr); } -int smbus_write_byte(device_t dev, u8 addr, u8 val) +int smbus_write_byte(struct device *dev, u8 addr, u8 val) { return ops_smbus_bus(get_pbus_smbus(dev))->write_byte(dev, addr, val); } -int smbus_read_word(device_t dev, u8 addr) +int smbus_read_word(struct device *dev, u8 addr) { return ops_smbus_bus(get_pbus_smbus(dev))->read_word(dev, addr); } -int smbus_write_word(device_t dev, u8 addr, u16 val) +int smbus_write_word(struct device *dev, u8 addr, u16 val) { return ops_smbus_bus(get_pbus_smbus(dev))->write_word(dev, addr, val); } -int smbus_process_call(device_t dev, u8 cmd, u16 data) +int smbus_process_call(struct device *dev, u8 cmd, u16 data) { return ops_smbus_bus(get_pbus_smbus(dev))->process_call(dev, cmd, data); } -int smbus_block_read(device_t dev, u8 cmd, u8 bytes, u8 *buffer) +int smbus_block_read(struct device *dev, u8 cmd, u8 bytes, u8 *buffer) { return ops_smbus_bus(get_pbus_smbus(dev))->block_read(dev, cmd, bytes, buffer); } -int smbus_block_write(device_t dev, u8 cmd, u8 bytes, const u8 *buffer) +int smbus_block_write(struct device *dev, u8 cmd, u8 bytes, const u8 *buffer) { return ops_smbus_bus(get_pbus_smbus(dev))->block_write(dev, cmd, bytes, buffer); diff --git a/include/device/agp.h b/include/device/agp.h index e0d77fdb30..66dfb0db2d 100644 --- a/include/device/agp.h +++ b/include/device/agp.h @@ -20,7 +20,7 @@ unsigned int agp_scan_bus(struct bus *bus, unsigned min_devfn, unsigned max_devfn, unsigned int max); -unsigned int agp_scan_bridge(device_t dev, unsigned int max); +unsigned int agp_scan_bridge(struct device *dev, unsigned int max); extern struct device_operations default_agp_ops_bus; diff --git a/include/device/cardbus.h b/include/device/cardbus.h index eeb756236c..f7f813df15 100644 --- a/include/device/cardbus.h +++ b/include/device/cardbus.h @@ -17,11 +17,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -void cardbus_read_resources(device_t dev); +void cardbus_read_resources(struct device *dev); unsigned int cardbus_scan_bus(struct bus *bus, unsigned min_devfn, unsigned max_devfn, unsigned int max); -unsigned int cardbus_scan_bridge(device_t dev, unsigned int max); -void cardbus_enable_resources(device_t dev); +unsigned int cardbus_scan_bridge(struct device *dev, unsigned int max); +void cardbus_enable_resources(struct device *dev); extern struct device_operations default_cardbus_ops_bus; diff --git a/include/device/pciexp.h b/include/device/pciexp.h index 1cf0dad077..db05cf2c44 100644 --- a/include/device/pciexp.h +++ b/include/device/pciexp.h @@ -20,7 +20,7 @@ unsigned int pciexp_scan_bus(struct bus *bus, unsigned min_devfn, unsigned max_devfn, unsigned int max); -unsigned int pciexp_scan_bridge(device_t dev, unsigned int max); +unsigned int pciexp_scan_bridge(struct device *dev, unsigned int max); extern struct device_operations default_pciexp_ops_bus; diff --git a/include/device/pcix.h b/include/device/pcix.h index ac9e0e1e22..53d565214b 100644 --- a/include/device/pcix.h +++ b/include/device/pcix.h @@ -20,7 +20,7 @@ unsigned int pcix_scan_bus(struct bus *bus, unsigned min_devfn, unsigned max_devfn, unsigned int max); -unsigned int pcix_scan_bridge(device_t dev, unsigned int max); +unsigned int pcix_scan_bridge(struct device *dev, unsigned int max); const char *pcix_speed(unsigned sstatus); extern struct device_operations default_pcix_ops_bus; diff --git a/include/device/smbus.h b/include/device/smbus.h index 59cbf5c3a2..0bc77fec9f 100644 --- a/include/device/smbus.h +++ b/include/device/smbus.h @@ -24,17 +24,17 @@ /* Common smbus bus operations */ struct smbus_bus_operations { - int (*quick_read) (device_t dev); - int (*quick_write) (device_t dev); - int (*recv_byte) (device_t dev); - int (*send_byte) (device_t dev, u8 value); - int (*read_byte) (device_t dev, u8 addr); - int (*write_byte) (device_t dev, u8 addr, u8 value); - int (*read_word) (device_t dev, u8 addr); - int (*write_word) (device_t dev, u8 addr, u16 value); - int (*process_call)(device_t dev, u8 cmd, u16 data); - int (*block_read) (device_t dev, u8 cmd, u8 bytes, u8 *buffer); - int (*block_write) (device_t dev, u8 cmd, u8 bytes, const u8 *buffer); + int (*quick_read) (struct device *dev); + int (*quick_write) (struct device *dev); + int (*recv_byte) (struct device *dev); + int (*send_byte) (struct device *dev, u8 value); + int (*read_byte) (struct device *dev, u8 addr); + int (*write_byte) (struct device *dev, u8 addr, u8 value); + int (*read_word) (struct device *dev, u8 addr); + int (*write_word) (struct device *dev, u8 addr, u16 value); + int (*process_call)(struct device *dev, u8 cmd, u16 data); + int (*block_read) (struct device *dev, u8 cmd, u8 bytes, u8 *buffer); + int (*block_write) (struct device *dev, u8 cmd, u8 bytes, const u8 *buffer); }; static inline const struct smbus_bus_operations *ops_smbus_bus(struct bus *bus) @@ -46,20 +46,20 @@ static inline const struct smbus_bus_operations *ops_smbus_bus(struct bus *bus) } return bops; } -struct bus *get_pbus_smbus(device_t dev); -int smbus_set_link(device_t dev); +struct bus *get_pbus_smbus(struct device *dev); +int smbus_set_link(struct device *dev); -int smbus_quick_read(device_t dev); -int smbus_quick_write(device_t dev); -int smbus_recv_byte(device_t dev); -int smbus_send_byte(device_t dev, u8 byte); -int smbus_read_byte(device_t dev, u8 addr); -int smbus_write_byte(device_t dev, u8 addr, u8 val); -int smbus_read_word(device_t dev, u8 addr); -int smbus_write_word(device_t dev, u8 addr, u16 val); -int smbus_process_call(device_t dev, u8 cmd, u16 data); -int smbus_block_read(device_t dev, u8 cmd, u8 bytes, u8 *buffer); -int smbus_block_write(device_t dev, u8 cmd, u8 bytes, const u8 *buffer); +int smbus_quick_read(struct device *dev); +int smbus_quick_write(struct device *dev); +int smbus_recv_byte(struct device *dev); +int smbus_send_byte(struct device *dev, u8 byte); +int smbus_read_byte(struct device *dev, u8 addr); +int smbus_write_byte(struct device *dev, u8 addr, u8 val); +int smbus_read_word(struct device *dev, u8 addr); +int smbus_write_word(struct device *dev, u8 addr, u16 val); +int smbus_process_call(struct device *dev, u8 cmd, u16 data); +int smbus_block_read(struct device *dev, u8 cmd, u8 bytes, u8 *buffer); +int smbus_block_write(struct device *dev, u8 cmd, u8 bytes, const u8 *buffer); #endif /* DEVICE_SMBUS_H */ diff --git a/superio/winbond/w83627hf/w83627hf_early_init.c b/superio/winbond/w83627hf/w83627hf_early_init.c index e449c4ae9c..ce4e623a68 100644 --- a/superio/winbond/w83627hf/w83627hf_early_init.c +++ b/superio/winbond/w83627hf/w83627hf_early_init.c @@ -1,12 +1,12 @@ #include #include "w83627hf.h" -static void w83627hf_disable_dev(device_t dev) +static void w83627hf_disable_dev(struct device *dev) { pnp_set_logical_device(dev); pnp_set_enable(dev, 0); } -static void w83627hf_enable_dev(device_t dev, unsigned iobase) +static void w83627hf_enable_dev(struct device *dev, unsigned iobase) { pnp_set_logical_device(dev); pnp_set_enable(dev, 0); diff --git a/superio/winbond/w83627hf/w83627hf_early_serial.c b/superio/winbond/w83627hf/w83627hf_early_serial.c index 6ca089ac50..80dc33b990 100644 --- a/superio/winbond/w83627hf/w83627hf_early_serial.c +++ b/superio/winbond/w83627hf/w83627hf_early_serial.c @@ -1,18 +1,18 @@ #include #include "w83627hf.h" -static inline void pnp_enter_ext_func_mode(device_t dev) +static inline void pnp_enter_ext_func_mode(struct device *dev) { unsigned port = dev>>8; outb(0x87, port); outb(0x87, port); } -static void pnp_exit_ext_func_mode(device_t dev) +static void pnp_exit_ext_func_mode(struct device *dev) { unsigned port = dev>>8; outb(0xaa, port); } -static void w83627hf_enable_serial(device_t dev, unsigned iobase) +static void w83627hf_enable_serial(struct device *dev, unsigned iobase) { pnp_enter_ext_func_mode(dev); pnp_set_logical_device(dev);