mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
There are still lots of 'device_t' occurences in (currently unused,
it seems) code. As we stopped using device_t long ago, these should be removed, too. For reference, device_t previously was: typedef struct device * device_t; Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@307 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
16d16c155f
commit
fd9b65d4a1
13 changed files with 74 additions and 72 deletions
|
@ -24,7 +24,7 @@
|
|||
#include <device/pci_ids.h>
|
||||
#include <device/agp.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -39,9 +39,9 @@
|
|||
#include <cpu/amd/model_fxx_rev.h>
|
||||
#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));
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <device/pci_ids.h>
|
||||
#include <device/pciexp.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <device/pci_ids.h>
|
||||
#include <device/pcix.h>
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <device/path.h>
|
||||
#include <device/smbus.h>
|
||||
|
||||
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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#include <arch/romcc_io.h>
|
||||
#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);
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
#include <arch/romcc_io.h>
|
||||
#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);
|
||||
|
|
Loading…
Add table
Reference in a new issue