Commit 3c78bc61 authored by Ryan Desfosses's avatar Ryan Desfosses Committed by Bjorn Helgaas

PCI: Whitespace cleanup

Fix various whitespace errors.

No functional change.

[bhelgaas: fix other similar problems]
Signed-off-by: default avatarRyan Desfosses <ryan@desfo.org>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent b7fe9434
...@@ -614,9 +614,9 @@ static inline struct mvebu_pcie *sys_to_pcie(struct pci_sys_data *sys) ...@@ -614,9 +614,9 @@ static inline struct mvebu_pcie *sys_to_pcie(struct pci_sys_data *sys)
return sys->private_data; return sys->private_data;
} }
static struct mvebu_pcie_port * static struct mvebu_pcie_port *mvebu_pcie_find_port(struct mvebu_pcie *pcie,
mvebu_pcie_find_port(struct mvebu_pcie *pcie, struct pci_bus *bus, struct pci_bus *bus,
int devfn) int devfn)
{ {
int i; int i;
...@@ -781,10 +781,10 @@ static void mvebu_pcie_add_bus(struct pci_bus *bus) ...@@ -781,10 +781,10 @@ static void mvebu_pcie_add_bus(struct pci_bus *bus)
} }
static resource_size_t mvebu_pcie_align_resource(struct pci_dev *dev, static resource_size_t mvebu_pcie_align_resource(struct pci_dev *dev,
const struct resource *res, const struct resource *res,
resource_size_t start, resource_size_t start,
resource_size_t size, resource_size_t size,
resource_size_t align) resource_size_t align)
{ {
if (dev->bus->number != 0) if (dev->bus->number != 0)
return start; return start;
...@@ -834,7 +834,8 @@ static void mvebu_pcie_enable(struct mvebu_pcie *pcie) ...@@ -834,7 +834,8 @@ static void mvebu_pcie_enable(struct mvebu_pcie *pcie)
* found, maps it. * found, maps it.
*/ */
static void __iomem *mvebu_pcie_map_registers(struct platform_device *pdev, static void __iomem *mvebu_pcie_map_registers(struct platform_device *pdev,
struct device_node *np, struct mvebu_pcie_port *port) struct device_node *np,
struct mvebu_pcie_port *port)
{ {
struct resource regs; struct resource regs;
int ret = 0; int ret = 0;
......
...@@ -56,9 +56,9 @@ struct cpci_hp_controller_ops { ...@@ -56,9 +56,9 @@ struct cpci_hp_controller_ops {
int (*enable_irq) (void); int (*enable_irq) (void);
int (*disable_irq) (void); int (*disable_irq) (void);
int (*check_irq) (void *dev_id); int (*check_irq) (void *dev_id);
int (*hardware_test) (struct slot* slot, u32 value); int (*hardware_test) (struct slot *slot, u32 value);
u8 (*get_power) (struct slot* slot); u8 (*get_power) (struct slot *slot);
int (*set_power) (struct slot* slot, int value); int (*set_power) (struct slot *slot, int value);
}; };
struct cpci_hp_controller { struct cpci_hp_controller {
...@@ -89,13 +89,13 @@ int cpci_hp_stop(void); ...@@ -89,13 +89,13 @@ int cpci_hp_stop(void);
u8 cpci_get_attention_status(struct slot *slot); u8 cpci_get_attention_status(struct slot *slot);
u8 cpci_get_latch_status(struct slot *slot); u8 cpci_get_latch_status(struct slot *slot);
u8 cpci_get_adapter_status(struct slot *slot); u8 cpci_get_adapter_status(struct slot *slot);
u16 cpci_get_hs_csr(struct slot * slot); u16 cpci_get_hs_csr(struct slot *slot);
int cpci_set_attention_status(struct slot *slot, int status); int cpci_set_attention_status(struct slot *slot, int status);
int cpci_check_and_clear_ins(struct slot * slot); int cpci_check_and_clear_ins(struct slot *slot);
int cpci_check_ext(struct slot * slot); int cpci_check_ext(struct slot *slot);
int cpci_clear_ext(struct slot * slot); int cpci_clear_ext(struct slot *slot);
int cpci_led_on(struct slot * slot); int cpci_led_on(struct slot *slot);
int cpci_led_off(struct slot * slot); int cpci_led_off(struct slot *slot);
int cpci_configure_slot(struct slot *slot); int cpci_configure_slot(struct slot *slot);
int cpci_unconfigure_slot(struct slot *slot); int cpci_unconfigure_slot(struct slot *slot);
......
...@@ -65,10 +65,10 @@ static int thread_finished; ...@@ -65,10 +65,10 @@ static int thread_finished;
static int enable_slot(struct hotplug_slot *slot); static int enable_slot(struct hotplug_slot *slot);
static int disable_slot(struct hotplug_slot *slot); static int disable_slot(struct hotplug_slot *slot);
static int set_attention_status(struct hotplug_slot *slot, u8 value); static int set_attention_status(struct hotplug_slot *slot, u8 value);
static int get_power_status(struct hotplug_slot *slot, u8 * value); static int get_power_status(struct hotplug_slot *slot, u8 *value);
static int get_attention_status(struct hotplug_slot *slot, u8 * value); static int get_attention_status(struct hotplug_slot *slot, u8 *value);
static int get_adapter_status(struct hotplug_slot *slot, u8 * value); static int get_adapter_status(struct hotplug_slot *slot, u8 *value);
static int get_latch_status(struct hotplug_slot *slot, u8 * value); static int get_latch_status(struct hotplug_slot *slot, u8 *value);
static struct hotplug_slot_ops cpci_hotplug_slot_ops = { static struct hotplug_slot_ops cpci_hotplug_slot_ops = {
.enable_slot = enable_slot, .enable_slot = enable_slot,
...@@ -168,7 +168,7 @@ cpci_get_power_status(struct slot *slot) ...@@ -168,7 +168,7 @@ cpci_get_power_status(struct slot *slot)
} }
static int static int
get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
{ {
struct slot *slot = hotplug_slot->private; struct slot *slot = hotplug_slot->private;
...@@ -177,7 +177,7 @@ get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) ...@@ -177,7 +177,7 @@ get_power_status(struct hotplug_slot *hotplug_slot, u8 * value)
} }
static int static int
get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value) get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
{ {
struct slot *slot = hotplug_slot->private; struct slot *slot = hotplug_slot->private;
...@@ -192,14 +192,14 @@ set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) ...@@ -192,14 +192,14 @@ set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
} }
static int static int
get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value) get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
{ {
*value = hotplug_slot->info->adapter_status; *value = hotplug_slot->info->adapter_status;
return 0; return 0;
} }
static int static int
get_latch_status(struct hotplug_slot *hotplug_slot, u8 * value) get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
{ {
*value = hotplug_slot->info->latch_status; *value = hotplug_slot->info->latch_status;
return 0; return 0;
...@@ -362,7 +362,7 @@ static int ...@@ -362,7 +362,7 @@ static int
init_slots(int clear_ins) init_slots(int clear_ins)
{ {
struct slot *slot; struct slot *slot;
struct pci_dev* dev; struct pci_dev *dev;
dbg("%s - enter", __func__); dbg("%s - enter", __func__);
down_read(&list_rwsem); down_read(&list_rwsem);
......
...@@ -46,7 +46,7 @@ extern int cpci_debug; ...@@ -46,7 +46,7 @@ extern int cpci_debug;
#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg) #define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME , ## arg)
u8 cpci_get_attention_status(struct slot* slot) u8 cpci_get_attention_status(struct slot *slot)
{ {
int hs_cap; int hs_cap;
u16 hs_csr; u16 hs_csr;
...@@ -66,7 +66,7 @@ u8 cpci_get_attention_status(struct slot* slot) ...@@ -66,7 +66,7 @@ u8 cpci_get_attention_status(struct slot* slot)
return hs_csr & 0x0008 ? 1 : 0; return hs_csr & 0x0008 ? 1 : 0;
} }
int cpci_set_attention_status(struct slot* slot, int status) int cpci_set_attention_status(struct slot *slot, int status)
{ {
int hs_cap; int hs_cap;
u16 hs_csr; u16 hs_csr;
...@@ -93,7 +93,7 @@ int cpci_set_attention_status(struct slot* slot, int status) ...@@ -93,7 +93,7 @@ int cpci_set_attention_status(struct slot* slot, int status)
return 1; return 1;
} }
u16 cpci_get_hs_csr(struct slot* slot) u16 cpci_get_hs_csr(struct slot *slot)
{ {
int hs_cap; int hs_cap;
u16 hs_csr; u16 hs_csr;
...@@ -111,7 +111,7 @@ u16 cpci_get_hs_csr(struct slot* slot) ...@@ -111,7 +111,7 @@ u16 cpci_get_hs_csr(struct slot* slot)
return hs_csr; return hs_csr;
} }
int cpci_check_and_clear_ins(struct slot* slot) int cpci_check_and_clear_ins(struct slot *slot)
{ {
int hs_cap; int hs_cap;
u16 hs_csr; u16 hs_csr;
...@@ -140,7 +140,7 @@ int cpci_check_and_clear_ins(struct slot* slot) ...@@ -140,7 +140,7 @@ int cpci_check_and_clear_ins(struct slot* slot)
return ins; return ins;
} }
int cpci_check_ext(struct slot* slot) int cpci_check_ext(struct slot *slot)
{ {
int hs_cap; int hs_cap;
u16 hs_csr; u16 hs_csr;
...@@ -161,7 +161,7 @@ int cpci_check_ext(struct slot* slot) ...@@ -161,7 +161,7 @@ int cpci_check_ext(struct slot* slot)
return ext; return ext;
} }
int cpci_clear_ext(struct slot* slot) int cpci_clear_ext(struct slot *slot)
{ {
int hs_cap; int hs_cap;
u16 hs_csr; u16 hs_csr;
...@@ -187,7 +187,7 @@ int cpci_clear_ext(struct slot* slot) ...@@ -187,7 +187,7 @@ int cpci_clear_ext(struct slot* slot)
return 0; return 0;
} }
int cpci_led_on(struct slot* slot) int cpci_led_on(struct slot *slot)
{ {
int hs_cap; int hs_cap;
u16 hs_csr; u16 hs_csr;
...@@ -216,7 +216,7 @@ int cpci_led_on(struct slot* slot) ...@@ -216,7 +216,7 @@ int cpci_led_on(struct slot* slot)
return 0; return 0;
} }
int cpci_led_off(struct slot* slot) int cpci_led_off(struct slot *slot)
{ {
int hs_cap; int hs_cap;
u16 hs_csr; u16 hs_csr;
...@@ -303,7 +303,7 @@ int cpci_configure_slot(struct slot *slot) ...@@ -303,7 +303,7 @@ int cpci_configure_slot(struct slot *slot)
return ret; return ret;
} }
int cpci_unconfigure_slot(struct slot* slot) int cpci_unconfigure_slot(struct slot *slot)
{ {
struct pci_dev *dev, *temp; struct pci_dev *dev, *temp;
......
...@@ -78,8 +78,8 @@ static struct cpci_hp_controller generic_hpc; ...@@ -78,8 +78,8 @@ static struct cpci_hp_controller generic_hpc;
static int __init validate_parameters(void) static int __init validate_parameters(void)
{ {
char* str; char *str;
char* p; char *p;
unsigned long tmp; unsigned long tmp;
if(!bridge) { if(!bridge) {
...@@ -142,8 +142,8 @@ static int query_enum(void) ...@@ -142,8 +142,8 @@ static int query_enum(void)
static int __init cpcihp_generic_init(void) static int __init cpcihp_generic_init(void)
{ {
int status; int status;
struct resource* r; struct resource *r;
struct pci_dev* dev; struct pci_dev *dev;
info(DRIVER_DESC " version: " DRIVER_VERSION); info(DRIVER_DESC " version: " DRIVER_VERSION);
status = validate_parameters(); status = validate_parameters();
......
...@@ -295,7 +295,7 @@ static struct pci_driver zt5550_hc_driver = { ...@@ -295,7 +295,7 @@ static struct pci_driver zt5550_hc_driver = {
static int __init zt5550_init(void) static int __init zt5550_init(void)
{ {
struct resource* r; struct resource *r;
int rc; int rc;
info(DRIVER_DESC " version: " DRIVER_VERSION); info(DRIVER_DESC " version: " DRIVER_VERSION);
......
...@@ -255,7 +255,7 @@ struct pci_func { ...@@ -255,7 +255,7 @@ struct pci_func {
struct pci_resource *io_head; struct pci_resource *io_head;
struct pci_resource *bus_head; struct pci_resource *bus_head;
struct timer_list *p_task_event; struct timer_list *p_task_event;
struct pci_dev* pci_dev; struct pci_dev *pci_dev;
}; };
struct slot { struct slot {
...@@ -278,7 +278,7 @@ struct slot { ...@@ -278,7 +278,7 @@ struct slot {
}; };
struct pci_resource { struct pci_resource {
struct pci_resource * next; struct pci_resource *next;
u32 base; u32 base;
u32 length; u32 length;
}; };
......
...@@ -94,7 +94,7 @@ static inline int is_slot66mhz(struct slot *slot) ...@@ -94,7 +94,7 @@ static inline int is_slot66mhz(struct slot *slot)
* *
* Returns pointer to the head of the SMBIOS tables (or %NULL). * Returns pointer to the head of the SMBIOS tables (or %NULL).
*/ */
static void __iomem * detect_SMBIOS_pointer(void __iomem *begin, void __iomem *end) static void __iomem *detect_SMBIOS_pointer(void __iomem *begin, void __iomem *end)
{ {
void __iomem *fp; void __iomem *fp;
void __iomem *endp; void __iomem *endp;
...@@ -131,7 +131,7 @@ static void __iomem * detect_SMBIOS_pointer(void __iomem *begin, void __iomem *e ...@@ -131,7 +131,7 @@ static void __iomem * detect_SMBIOS_pointer(void __iomem *begin, void __iomem *e
* *
* For unexpected switch opens * For unexpected switch opens
*/ */
static int init_SERR(struct controller * ctrl) static int init_SERR(struct controller *ctrl)
{ {
u32 tempdword; u32 tempdword;
u32 number_of_slots; u32 number_of_slots;
...@@ -291,7 +291,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot) ...@@ -291,7 +291,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
kfree(slot); kfree(slot);
} }
static int ctrl_slot_cleanup (struct controller * ctrl) static int ctrl_slot_cleanup (struct controller *ctrl)
{ {
struct slot *old_slot, *next_slot; struct slot *old_slot, *next_slot;
......
...@@ -39,9 +39,9 @@ ...@@ -39,9 +39,9 @@
#include <linux/kthread.h> #include <linux/kthread.h>
#include "cpqphp.h" #include "cpqphp.h"
static u32 configure_new_device(struct controller* ctrl, struct pci_func *func, static u32 configure_new_device(struct controller *ctrl, struct pci_func *func,
u8 behind_bridge, struct resource_lists *resources); u8 behind_bridge, struct resource_lists *resources);
static int configure_new_function(struct controller* ctrl, struct pci_func *func, static int configure_new_function(struct controller *ctrl, struct pci_func *func,
u8 behind_bridge, struct resource_lists *resources); u8 behind_bridge, struct resource_lists *resources);
static void interrupt_event_handler(struct controller *ctrl); static void interrupt_event_handler(struct controller *ctrl);
...@@ -64,7 +64,7 @@ static void long_delay(int delay) ...@@ -64,7 +64,7 @@ static void long_delay(int delay)
/* FIXME: The following line needs to be somewhere else... */ /* FIXME: The following line needs to be somewhere else... */
#define WRONG_BUS_FREQUENCY 0x07 #define WRONG_BUS_FREQUENCY 0x07
static u8 handle_switch_change(u8 change, struct controller * ctrl) static u8 handle_switch_change(u8 change, struct controller *ctrl)
{ {
int hp_slot; int hp_slot;
u8 rc = 0; u8 rc = 0;
...@@ -138,7 +138,7 @@ static struct slot *cpqhp_find_slot(struct controller *ctrl, u8 device) ...@@ -138,7 +138,7 @@ static struct slot *cpqhp_find_slot(struct controller *ctrl, u8 device)
} }
static u8 handle_presence_change(u16 change, struct controller * ctrl) static u8 handle_presence_change(u16 change, struct controller *ctrl)
{ {
int hp_slot; int hp_slot;
u8 rc = 0; u8 rc = 0;
...@@ -232,7 +232,7 @@ static u8 handle_presence_change(u16 change, struct controller * ctrl) ...@@ -232,7 +232,7 @@ static u8 handle_presence_change(u16 change, struct controller * ctrl)
} }
static u8 handle_power_fault(u8 change, struct controller * ctrl) static u8 handle_power_fault(u8 change, struct controller *ctrl)
{ {
int hp_slot; int hp_slot;
u8 rc = 0; u8 rc = 0;
...@@ -997,7 +997,7 @@ struct pci_func *cpqhp_slot_create(u8 busnumber) ...@@ -997,7 +997,7 @@ struct pci_func *cpqhp_slot_create(u8 busnumber)
* *
* Returns %0 if successful, !0 otherwise. * Returns %0 if successful, !0 otherwise.
*/ */
static int slot_remove(struct pci_func * old_slot) static int slot_remove(struct pci_func *old_slot)
{ {
struct pci_func *next; struct pci_func *next;
...@@ -1109,7 +1109,7 @@ struct pci_func *cpqhp_slot_find(u8 bus, u8 device, u8 index) ...@@ -1109,7 +1109,7 @@ struct pci_func *cpqhp_slot_find(u8 bus, u8 device, u8 index)
/* DJZ: I don't think is_bridge will work as is. /* DJZ: I don't think is_bridge will work as is.
* FIXME */ * FIXME */
static int is_bridge(struct pci_func * func) static int is_bridge(struct pci_func *func)
{ {
/* Check the header type */ /* Check the header type */
if (((func->config_space[0x03] >> 16) & 0xFF) == 0x01) if (((func->config_space[0x03] >> 16) & 0xFF) == 0x01)
...@@ -1625,7 +1625,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl) ...@@ -1625,7 +1625,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl)
* @replace_flag: whether replacing or adding a new device * @replace_flag: whether replacing or adding a new device
* @ctrl: target controller * @ctrl: target controller
*/ */
static u32 remove_board(struct pci_func * func, u32 replace_flag, struct controller * ctrl) static u32 remove_board(struct pci_func *func, u32 replace_flag, struct controller *ctrl)
{ {
int index; int index;
u8 skip = 0; u8 skip = 0;
...@@ -1742,7 +1742,7 @@ static void pushbutton_helper_thread(unsigned long data) ...@@ -1742,7 +1742,7 @@ static void pushbutton_helper_thread(unsigned long data)
/* this is the main worker thread */ /* this is the main worker thread */
static int event_thread(void* data) static int event_thread(void *data)
{ {
struct controller *ctrl; struct controller *ctrl;
...@@ -1992,7 +1992,7 @@ int cpqhp_process_SI(struct controller *ctrl, struct pci_func *func) ...@@ -1992,7 +1992,7 @@ int cpqhp_process_SI(struct controller *ctrl, struct pci_func *func)
u16 temp_word; u16 temp_word;
u32 tempdword; u32 tempdword;
int rc; int rc;
struct slot* p_slot; struct slot *p_slot;
int physical_slot = 0; int physical_slot = 0;
tempdword = 0; tempdword = 0;
...@@ -2088,7 +2088,7 @@ int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func) ...@@ -2088,7 +2088,7 @@ int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func)
u8 replace_flag; u8 replace_flag;
u32 rc = 0; u32 rc = 0;
unsigned int devfn; unsigned int devfn;
struct slot* p_slot; struct slot *p_slot;
struct pci_bus *pci_bus = ctrl->pci_bus; struct pci_bus *pci_bus = ctrl->pci_bus;
int physical_slot=0; int physical_slot=0;
...@@ -2270,8 +2270,8 @@ int cpqhp_hardware_test(struct controller *ctrl, int test_num) ...@@ -2270,8 +2270,8 @@ int cpqhp_hardware_test(struct controller *ctrl, int test_num)
* *
* Returns 0 if success. * Returns 0 if success.
*/ */
static u32 configure_new_device(struct controller * ctrl, struct pci_func * func, static u32 configure_new_device(struct controller *ctrl, struct pci_func *func,
u8 behind_bridge, struct resource_lists * resources) u8 behind_bridge, struct resource_lists *resources)
{ {
u8 temp_byte, function, max_functions, stop_it; u8 temp_byte, function, max_functions, stop_it;
int rc; int rc;
......
...@@ -107,7 +107,7 @@ static spinlock_t int15_lock; ...@@ -107,7 +107,7 @@ static spinlock_t int15_lock;
*/ */
static u32 add_byte( u32 **p_buffer, u8 value, u32 *used, u32 *avail) static u32 add_byte(u32 **p_buffer, u8 value, u32 *used, u32 *avail)
{ {
u8 **tByte; u8 **tByte;
...@@ -122,7 +122,7 @@ static u32 add_byte( u32 **p_buffer, u8 value, u32 *used, u32 *avail) ...@@ -122,7 +122,7 @@ static u32 add_byte( u32 **p_buffer, u8 value, u32 *used, u32 *avail)
} }
static u32 add_dword( u32 **p_buffer, u32 value, u32 *used, u32 *avail) static u32 add_dword(u32 **p_buffer, u32 value, u32 *used, u32 *avail)
{ {
if ((*used + 4) > *avail) if ((*used + 4) > *avail)
return(1); return(1);
...@@ -267,12 +267,12 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -267,12 +267,12 @@ static u32 store_HRT (void __iomem *rom_start)
ctrl = cpqhp_ctrl_list; ctrl = cpqhp_ctrl_list;
/* The revision of this structure */ /* The revision of this structure */
rc = add_byte( &pFill, 1 + ctrl->push_flag, &usedbytes, &available); rc = add_byte(&pFill, 1 + ctrl->push_flag, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
/* The number of controllers */ /* The number of controllers */
rc = add_byte( &pFill, 1, &usedbytes, &available); rc = add_byte(&pFill, 1, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
...@@ -282,22 +282,22 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -282,22 +282,22 @@ static u32 store_HRT (void __iomem *rom_start)
numCtrl++; numCtrl++;
/* The bus number */ /* The bus number */
rc = add_byte( &pFill, ctrl->bus, &usedbytes, &available); rc = add_byte(&pFill, ctrl->bus, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
/* The device Number */ /* The device Number */
rc = add_byte( &pFill, PCI_SLOT(ctrl->pci_dev->devfn), &usedbytes, &available); rc = add_byte(&pFill, PCI_SLOT(ctrl->pci_dev->devfn), &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
/* The function Number */ /* The function Number */
rc = add_byte( &pFill, PCI_FUNC(ctrl->pci_dev->devfn), &usedbytes, &available); rc = add_byte(&pFill, PCI_FUNC(ctrl->pci_dev->devfn), &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
/* Skip the number of available entries */ /* Skip the number of available entries */
rc = add_dword( &pFill, 0, &usedbytes, &available); rc = add_dword(&pFill, 0, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
...@@ -311,12 +311,12 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -311,12 +311,12 @@ static u32 store_HRT (void __iomem *rom_start)
loop ++; loop ++;
/* base */ /* base */
rc = add_dword( &pFill, resNode->base, &usedbytes, &available); rc = add_dword(&pFill, resNode->base, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
/* length */ /* length */
rc = add_dword( &pFill, resNode->length, &usedbytes, &available); rc = add_dword(&pFill, resNode->length, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
...@@ -336,12 +336,12 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -336,12 +336,12 @@ static u32 store_HRT (void __iomem *rom_start)
loop ++; loop ++;
/* base */ /* base */
rc = add_dword( &pFill, resNode->base, &usedbytes, &available); rc = add_dword(&pFill, resNode->base, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
/* length */ /* length */
rc = add_dword( &pFill, resNode->length, &usedbytes, &available); rc = add_dword(&pFill, resNode->length, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
...@@ -361,12 +361,12 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -361,12 +361,12 @@ static u32 store_HRT (void __iomem *rom_start)
loop ++; loop ++;
/* base */ /* base */
rc = add_dword( &pFill, resNode->base, &usedbytes, &available); rc = add_dword(&pFill, resNode->base, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
/* length */ /* length */
rc = add_dword( &pFill, resNode->length, &usedbytes, &available); rc = add_dword(&pFill, resNode->length, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
...@@ -386,12 +386,12 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -386,12 +386,12 @@ static u32 store_HRT (void __iomem *rom_start)
loop ++; loop ++;
/* base */ /* base */
rc = add_dword( &pFill, resNode->base, &usedbytes, &available); rc = add_dword(&pFill, resNode->base, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
/* length */ /* length */
rc = add_dword( &pFill, resNode->length, &usedbytes, &available); rc = add_dword(&pFill, resNode->length, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
......
...@@ -81,7 +81,7 @@ static void __iomem *detect_HRT_floating_pointer(void __iomem *begin, void __iom ...@@ -81,7 +81,7 @@ static void __iomem *detect_HRT_floating_pointer(void __iomem *begin, void __iom
} }
int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func) int cpqhp_configure_device (struct controller *ctrl, struct pci_func *func)
{ {
struct pci_bus *child; struct pci_bus *child;
int num; int num;
...@@ -121,7 +121,7 @@ int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func) ...@@ -121,7 +121,7 @@ int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func)
} }
int cpqhp_unconfigure_device(struct pci_func* func) int cpqhp_unconfigure_device(struct pci_func *func)
{ {
int j; int j;
...@@ -129,7 +129,7 @@ int cpqhp_unconfigure_device(struct pci_func* func) ...@@ -129,7 +129,7 @@ int cpqhp_unconfigure_device(struct pci_func* func)
pci_lock_rescan_remove(); pci_lock_rescan_remove();
for (j=0; j<8 ; j++) { for (j=0; j<8 ; j++) {
struct pci_dev* temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j)); struct pci_dev *temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j));
if (temp) { if (temp) {
pci_dev_put(temp); pci_dev_put(temp);
pci_stop_and_remove_bus_device(temp); pci_stop_and_remove_bus_device(temp);
...@@ -203,7 +203,7 @@ int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num) ...@@ -203,7 +203,7 @@ int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num)
} }
static int PCI_ScanBusForNonBridge(struct controller *ctrl, u8 bus_num, u8 * dev_num) static int PCI_ScanBusForNonBridge(struct controller *ctrl, u8 bus_num, u8 *dev_num)
{ {
u16 tdevice; u16 tdevice;
u32 work; u32 work;
...@@ -280,7 +280,7 @@ static int PCI_GetBusDevHelper(struct controller *ctrl, u8 *bus_num, u8 *dev_num ...@@ -280,7 +280,7 @@ static int PCI_GetBusDevHelper(struct controller *ctrl, u8 *bus_num, u8 *dev_num
} }
int cpqhp_get_bus_dev (struct controller *ctrl, u8 * bus_num, u8 * dev_num, u8 slot) int cpqhp_get_bus_dev (struct controller *ctrl, u8 *bus_num, u8 *dev_num, u8 slot)
{ {
/* plain (bridges allowed) */ /* plain (bridges allowed) */
return PCI_GetBusDevHelper(ctrl, bus_num, dev_num, slot, 0); return PCI_GetBusDevHelper(ctrl, bus_num, dev_num, slot, 0);
...@@ -465,7 +465,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug) ...@@ -465,7 +465,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug)
* *
* returns 0 if success * returns 0 if success
*/ */
int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func *new_slot)
{ {
long rc; long rc;
u8 class_code; u8 class_code;
...@@ -549,7 +549,7 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) ...@@ -549,7 +549,7 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot)
* *
* returns 0 if success * returns 0 if success
*/ */
int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func * func) int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func *func)
{ {
u8 cloop; u8 cloop;
u8 header_type; u8 header_type;
...@@ -686,7 +686,7 @@ int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func * func) ...@@ -686,7 +686,7 @@ int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func * func)
* *
* returns 0 if success * returns 0 if success
*/ */
int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func) int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func *func)
{ {
u8 cloop; u8 cloop;
u8 header_type; u8 header_type;
...@@ -949,7 +949,7 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func) ...@@ -949,7 +949,7 @@ int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func)
* *
* returns 0 if success * returns 0 if success
*/ */
int cpqhp_configure_board(struct controller *ctrl, struct pci_func * func) int cpqhp_configure_board(struct controller *ctrl, struct pci_func *func)
{ {
int cloop; int cloop;
u8 header_type; u8 header_type;
...@@ -1027,7 +1027,7 @@ int cpqhp_configure_board(struct controller *ctrl, struct pci_func * func) ...@@ -1027,7 +1027,7 @@ int cpqhp_configure_board(struct controller *ctrl, struct pci_func * func)
* *
* returns 0 if the board is the same nonzero otherwise * returns 0 if the board is the same nonzero otherwise
*/ */
int cpqhp_valid_replace(struct controller *ctrl, struct pci_func * func) int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func)
{ {
u8 cloop; u8 cloop;
u8 header_type; u8 header_type;
...@@ -1419,7 +1419,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st ...@@ -1419,7 +1419,7 @@ int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_st
* *
* returns 0 if success * returns 0 if success
*/ */
int cpqhp_return_board_resources(struct pci_func * func, struct resource_lists * resources) int cpqhp_return_board_resources(struct pci_func *func, struct resource_lists *resources)
{ {
int rc = 0; int rc = 0;
struct pci_resource *node; struct pci_resource *node;
...@@ -1475,7 +1475,7 @@ int cpqhp_return_board_resources(struct pci_func * func, struct resource_lists * ...@@ -1475,7 +1475,7 @@ int cpqhp_return_board_resources(struct pci_func * func, struct resource_lists *
* *
* Puts node back in the resource list pointed to by head * Puts node back in the resource list pointed to by head
*/ */
void cpqhp_destroy_resource_list (struct resource_lists * resources) void cpqhp_destroy_resource_list (struct resource_lists *resources)
{ {
struct pci_resource *res, *tres; struct pci_resource *res, *tres;
...@@ -1522,7 +1522,7 @@ void cpqhp_destroy_resource_list (struct resource_lists * resources) ...@@ -1522,7 +1522,7 @@ void cpqhp_destroy_resource_list (struct resource_lists * resources)
* *
* Puts node back in the resource list pointed to by head * Puts node back in the resource list pointed to by head
*/ */
void cpqhp_destroy_board_resources (struct pci_func * func) void cpqhp_destroy_board_resources (struct pci_func *func)
{ {
struct pci_resource *res, *tres; struct pci_resource *res, *tres;
......
...@@ -79,7 +79,7 @@ static int show_ctrl (struct controller *ctrl, char *buf) ...@@ -79,7 +79,7 @@ static int show_ctrl (struct controller *ctrl, char *buf)
static int show_dev (struct controller *ctrl, char *buf) static int show_dev (struct controller *ctrl, char *buf)
{ {
char * out = buf; char *out = buf;
int index; int index;
struct pci_resource *res; struct pci_resource *res;
struct pci_func *new_slot; struct pci_func *new_slot;
......
...@@ -74,7 +74,7 @@ static inline int get_max_adapter_speed (struct hotplug_slot *hs, u8 *value) ...@@ -74,7 +74,7 @@ static inline int get_max_adapter_speed (struct hotplug_slot *hs, u8 *value)
static inline int get_cur_bus_info(struct slot **sl) static inline int get_cur_bus_info(struct slot **sl)
{ {
int rc = 1; int rc = 1;
struct slot * slot_cur = *sl; struct slot *slot_cur = *sl;
debug("options = %x\n", slot_cur->ctrl->options); debug("options = %x\n", slot_cur->ctrl->options);
debug("revision = %x\n", slot_cur->ctrl->revision); debug("revision = %x\n", slot_cur->ctrl->revision);
...@@ -114,8 +114,8 @@ static inline int slot_update(struct slot **sl) ...@@ -114,8 +114,8 @@ static inline int slot_update(struct slot **sl)
static int __init get_max_slots (void) static int __init get_max_slots (void)
{ {
struct slot * slot_cur; struct slot *slot_cur;
struct list_head * tmp; struct list_head *tmp;
u8 slot_count = 0; u8 slot_count = 0;
list_for_each(tmp, &ibmphp_slot_head) { list_for_each(tmp, &ibmphp_slot_head) {
...@@ -280,7 +280,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value) ...@@ -280,7 +280,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value)
return rc; return rc;
} }
static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value) static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
{ {
int rc = -ENODEV; int rc = -ENODEV;
struct slot *pslot; struct slot *pslot;
...@@ -311,7 +311,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value) ...@@ -311,7 +311,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value)
return rc; return rc;
} }
static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 * value) static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
{ {
int rc = -ENODEV; int rc = -ENODEV;
struct slot *pslot; struct slot *pslot;
...@@ -338,7 +338,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 * value) ...@@ -338,7 +338,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 * value)
} }
static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
{ {
int rc = -ENODEV; int rc = -ENODEV;
struct slot *pslot; struct slot *pslot;
...@@ -364,7 +364,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) ...@@ -364,7 +364,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value)
return rc; return rc;
} }
static int get_adapter_present(struct hotplug_slot *hotplug_slot, u8 * value) static int get_adapter_present(struct hotplug_slot *hotplug_slot, u8 *value)
{ {
int rc = -ENODEV; int rc = -ENODEV;
struct slot *pslot; struct slot *pslot;
...@@ -433,7 +433,7 @@ static int get_max_bus_speed(struct slot *slot) ...@@ -433,7 +433,7 @@ static int get_max_bus_speed(struct slot *slot)
} }
/* /*
static int get_max_adapter_speed_1(struct hotplug_slot *hotplug_slot, u8 * value, u8 flag) static int get_max_adapter_speed_1(struct hotplug_slot *hotplug_slot, u8 *value, u8 flag)
{ {
int rc = -ENODEV; int rc = -ENODEV;
struct slot *pslot; struct slot *pslot;
...@@ -471,7 +471,7 @@ static int get_max_adapter_speed_1(struct hotplug_slot *hotplug_slot, u8 * value ...@@ -471,7 +471,7 @@ static int get_max_adapter_speed_1(struct hotplug_slot *hotplug_slot, u8 * value
return rc; return rc;
} }
static int get_bus_name(struct hotplug_slot *hotplug_slot, char * value) static int get_bus_name(struct hotplug_slot *hotplug_slot, char *value)
{ {
int rc = -ENODEV; int rc = -ENODEV;
struct slot *pslot = NULL; struct slot *pslot = NULL;
...@@ -671,7 +671,7 @@ static struct pci_func *ibm_slot_find(u8 busno, u8 device, u8 function) ...@@ -671,7 +671,7 @@ static struct pci_func *ibm_slot_find(u8 busno, u8 device, u8 function)
{ {
struct pci_func *func_cur; struct pci_func *func_cur;
struct slot *slot_cur; struct slot *slot_cur;
struct list_head * tmp; struct list_head *tmp;
list_for_each(tmp, &ibmphp_slot_head) { list_for_each(tmp, &ibmphp_slot_head) {
slot_cur = list_entry(tmp, struct slot, ibm_slot_list); slot_cur = list_entry(tmp, struct slot, ibm_slot_list);
if (slot_cur->func) { if (slot_cur->func) {
...@@ -696,8 +696,8 @@ static struct pci_func *ibm_slot_find(u8 busno, u8 device, u8 function) ...@@ -696,8 +696,8 @@ static struct pci_func *ibm_slot_find(u8 busno, u8 device, u8 function)
static void free_slots(void) static void free_slots(void)
{ {
struct slot *slot_cur; struct slot *slot_cur;
struct list_head * tmp; struct list_head *tmp;
struct list_head * next; struct list_head *next;
debug("%s -- enter\n", __func__); debug("%s -- enter\n", __func__);
...@@ -825,10 +825,10 @@ static int ibm_configure_device(struct pci_func *func) ...@@ -825,10 +825,10 @@ static int ibm_configure_device(struct pci_func *func)
/******************************************************* /*******************************************************
* Returns whether the bus is empty or not * Returns whether the bus is empty or not
*******************************************************/ *******************************************************/
static int is_bus_empty(struct slot * slot_cur) static int is_bus_empty(struct slot *slot_cur)
{ {
int rc; int rc;
struct slot * tmp_slot; struct slot *tmp_slot;
u8 i = slot_cur->bus_on->slot_min; u8 i = slot_cur->bus_on->slot_min;
while (i <= slot_cur->bus_on->slot_max) { while (i <= slot_cur->bus_on->slot_max) {
...@@ -856,7 +856,7 @@ static int is_bus_empty(struct slot * slot_cur) ...@@ -856,7 +856,7 @@ static int is_bus_empty(struct slot * slot_cur)
* Parameters: slot * Parameters: slot
* Returns: bus is set (0) or error code * Returns: bus is set (0) or error code
***********************************************************/ ***********************************************************/
static int set_bus(struct slot * slot_cur) static int set_bus(struct slot *slot_cur)
{ {
int rc; int rc;
u8 speed; u8 speed;
...@@ -956,7 +956,7 @@ static int set_bus(struct slot * slot_cur) ...@@ -956,7 +956,7 @@ static int set_bus(struct slot * slot_cur)
static int check_limitations(struct slot *slot_cur) static int check_limitations(struct slot *slot_cur)
{ {
u8 i; u8 i;
struct slot * tmp_slot; struct slot *tmp_slot;
u8 count = 0; u8 count = 0;
u8 limitation = 0; u8 limitation = 0;
......
...@@ -563,7 +563,7 @@ static int first_slot_num (u8 slot_num, u8 first_slot, u8 var) ...@@ -563,7 +563,7 @@ static int first_slot_num (u8 slot_num, u8 first_slot, u8 var)
return rc; return rc;
} }
static struct opt_rio_lo * find_rxe_num (u8 slot_num) static struct opt_rio_lo *find_rxe_num (u8 slot_num)
{ {
struct opt_rio_lo *opt_lo_ptr; struct opt_rio_lo *opt_lo_ptr;
...@@ -575,7 +575,7 @@ static struct opt_rio_lo * find_rxe_num (u8 slot_num) ...@@ -575,7 +575,7 @@ static struct opt_rio_lo * find_rxe_num (u8 slot_num)
return NULL; return NULL;
} }
static struct opt_rio * find_chassis_num (u8 slot_num) static struct opt_rio *find_chassis_num (u8 slot_num)
{ {
struct opt_rio *opt_vg_ptr; struct opt_rio *opt_vg_ptr;
...@@ -593,7 +593,7 @@ static struct opt_rio * find_chassis_num (u8 slot_num) ...@@ -593,7 +593,7 @@ static struct opt_rio * find_chassis_num (u8 slot_num)
static u8 calculate_first_slot (u8 slot_num) static u8 calculate_first_slot (u8 slot_num)
{ {
u8 first_slot = 1; u8 first_slot = 1;
struct slot * slot_cur; struct slot *slot_cur;
list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) { list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) {
if (slot_cur->ctrl) { if (slot_cur->ctrl) {
...@@ -607,7 +607,7 @@ static u8 calculate_first_slot (u8 slot_num) ...@@ -607,7 +607,7 @@ static u8 calculate_first_slot (u8 slot_num)
#define SLOT_NAME_SIZE 30 #define SLOT_NAME_SIZE 30
static char *create_file_name (struct slot * slot_cur) static char *create_file_name (struct slot *slot_cur)
{ {
struct opt_rio *opt_vg_ptr = NULL; struct opt_rio *opt_vg_ptr = NULL;
struct opt_rio_lo *opt_lo_ptr = NULL; struct opt_rio_lo *opt_lo_ptr = NULL;
...@@ -1192,7 +1192,7 @@ int ibmphp_register_pci (void) ...@@ -1192,7 +1192,7 @@ int ibmphp_register_pci (void)
} }
return rc; return rc;
} }
static int ibmphp_probe (struct pci_dev * dev, const struct pci_device_id *ids) static int ibmphp_probe (struct pci_dev *dev, const struct pci_device_id *ids)
{ {
struct controller *ctrl; struct controller *ctrl;
......
...@@ -533,7 +533,7 @@ static u8 hpc_readcmdtoindex (u8 cmd, u8 index) ...@@ -533,7 +533,7 @@ static u8 hpc_readcmdtoindex (u8 cmd, u8 index)
* *
* Return 0 or error codes * Return 0 or error codes
*---------------------------------------------------------------------*/ *---------------------------------------------------------------------*/
int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus) int ibmphp_hpc_readslot (struct slot *pslot, u8 cmd, u8 *pstatus)
{ {
void __iomem *wpg_bbar = NULL; void __iomem *wpg_bbar = NULL;
struct controller *ctlr_ptr; struct controller *ctlr_ptr;
...@@ -672,7 +672,7 @@ int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus) ...@@ -672,7 +672,7 @@ int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus)
* *
* Action: issue a WRITE command to HPC * Action: issue a WRITE command to HPC
*---------------------------------------------------------------------*/ *---------------------------------------------------------------------*/
int ibmphp_hpc_writeslot (struct slot * pslot, u8 cmd) int ibmphp_hpc_writeslot (struct slot *pslot, u8 cmd)
{ {
void __iomem *wpg_bbar = NULL; void __iomem *wpg_bbar = NULL;
struct controller *ctlr_ptr; struct controller *ctlr_ptr;
...@@ -1102,7 +1102,7 @@ void __exit ibmphp_hpc_stop_poll_thread (void) ...@@ -1102,7 +1102,7 @@ void __exit ibmphp_hpc_stop_poll_thread (void)
* Value: * Value:
*---------------------------------------------------------------------*/ *---------------------------------------------------------------------*/
static int hpc_wait_ctlr_notworking (int timeout, struct controller *ctlr_ptr, void __iomem *wpg_bbar, static int hpc_wait_ctlr_notworking (int timeout, struct controller *ctlr_ptr, void __iomem *wpg_bbar,
u8 * pstatus) u8 *pstatus)
{ {
int rc = 0; int rc = 0;
u8 done = 0; u8 done = 0;
......
...@@ -47,7 +47,7 @@ static u8 find_sec_number (u8 primary_busno, u8 slotno); ...@@ -47,7 +47,7 @@ static u8 find_sec_number (u8 primary_busno, u8 slotno);
* We also assign the same irq numbers for multi function devices. * We also assign the same irq numbers for multi function devices.
* These are PIC mode, so shouldn't matter n.e.ways (hopefully) * These are PIC mode, so shouldn't matter n.e.ways (hopefully)
*/ */
static void assign_alt_irq (struct pci_func * cur_func, u8 class_code) static void assign_alt_irq (struct pci_func *cur_func, u8 class_code)
{ {
int j; int j;
for (j = 0; j < 4; j++) { for (j = 0; j < 4; j++) {
...@@ -1073,7 +1073,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno) ...@@ -1073,7 +1073,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
* Input: bridge function * Input: bridge function
* Output: amount of resources needed * Output: amount of resources needed
*****************************************************************************/ *****************************************************************************/
static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno) static struct res_needed *scan_behind_bridge (struct pci_func *func, u8 busno)
{ {
int count, len[6]; int count, len[6];
u16 vendor_id; u16 vendor_id;
......
...@@ -46,9 +46,9 @@ static struct bus_node *find_bus_wprev (u8, struct bus_node **, u8); ...@@ -46,9 +46,9 @@ static struct bus_node *find_bus_wprev (u8, struct bus_node **, u8);
static LIST_HEAD(gbuses); static LIST_HEAD(gbuses);
static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8 busno, int flag) static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc *curr, u8 busno, int flag)
{ {
struct bus_node * newbus; struct bus_node *newbus;
if (!(curr) && !(flag)) { if (!(curr) && !(flag)) {
err ("NULL pointer passed\n"); err ("NULL pointer passed\n");
...@@ -69,7 +69,7 @@ static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8 ...@@ -69,7 +69,7 @@ static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8
return newbus; return newbus;
} }
static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * curr) static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc *curr)
{ {
struct resource_node *rs; struct resource_node *rs;
...@@ -93,7 +93,7 @@ static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * cur ...@@ -93,7 +93,7 @@ static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * cur
static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node **new_range, struct ebda_pci_rsrc *curr, int flag, u8 first_bus) static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node **new_range, struct ebda_pci_rsrc *curr, int flag, u8 first_bus)
{ {
struct bus_node * newbus; struct bus_node *newbus;
struct range_node *newrange; struct range_node *newrange;
u8 num_ranges = 0; u8 num_ranges = 0;
...@@ -934,9 +934,9 @@ int ibmphp_remove_resource (struct resource_node *res) ...@@ -934,9 +934,9 @@ int ibmphp_remove_resource (struct resource_node *res)
return 0; return 0;
} }
static struct range_node * find_range (struct bus_node *bus_cur, struct resource_node * res) static struct range_node *find_range (struct bus_node *bus_cur, struct resource_node *res)
{ {
struct range_node * range = NULL; struct range_node *range = NULL;
switch (res->type) { switch (res->type) {
case IO: case IO:
......
...@@ -59,14 +59,12 @@ static bool debug; ...@@ -59,14 +59,12 @@ static bool debug;
#define DRIVER_DESC "PCI Hot Plug PCI Core" #define DRIVER_DESC "PCI Hot Plug PCI Core"
//////////////////////////////////////////////////////////////////
static LIST_HEAD(pci_hotplug_slot_list); static LIST_HEAD(pci_hotplug_slot_list);
static DEFINE_MUTEX(pci_hp_mutex); static DEFINE_MUTEX(pci_hp_mutex);
/* Weee, fun with macros... */ /* Weee, fun with macros... */
#define GET_STATUS(name,type) \ #define GET_STATUS(name, type) \
static int get_##name (struct hotplug_slot *slot, type *value) \ static int get_##name(struct hotplug_slot *slot, type *value) \
{ \ { \
struct hotplug_slot_ops *ops = slot->ops; \ struct hotplug_slot_ops *ops = slot->ops; \
int retval = 0; \ int retval = 0; \
...@@ -92,42 +90,41 @@ static ssize_t power_read_file(struct pci_slot *slot, char *buf) ...@@ -92,42 +90,41 @@ static ssize_t power_read_file(struct pci_slot *slot, char *buf)
retval = get_power_status(slot->hotplug, &value); retval = get_power_status(slot->hotplug, &value);
if (retval) if (retval)
goto exit; return retval;
retval = sprintf (buf, "%d\n", value);
exit: return sprintf(buf, "%d\n", value);
return retval;
} }
static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf, static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf,
size_t count) size_t count)
{ {
struct hotplug_slot *slot = pci_slot->hotplug; struct hotplug_slot *slot = pci_slot->hotplug;
unsigned long lpower; unsigned long lpower;
u8 power; u8 power;
int retval = 0; int retval = 0;
lpower = simple_strtoul (buf, NULL, 10); lpower = simple_strtoul(buf, NULL, 10);
power = (u8)(lpower & 0xff); power = (u8)(lpower & 0xff);
dbg ("power = %d\n", power); dbg("power = %d\n", power);
if (!try_module_get(slot->ops->owner)) { if (!try_module_get(slot->ops->owner)) {
retval = -ENODEV; retval = -ENODEV;
goto exit; goto exit;
} }
switch (power) { switch (power) {
case 0: case 0:
if (slot->ops->disable_slot) if (slot->ops->disable_slot)
retval = slot->ops->disable_slot(slot); retval = slot->ops->disable_slot(slot);
break; break;
case 1: case 1:
if (slot->ops->enable_slot) if (slot->ops->enable_slot)
retval = slot->ops->enable_slot(slot); retval = slot->ops->enable_slot(slot);
break; break;
default: default:
err ("Illegal value specified for power\n"); err("Illegal value specified for power\n");
retval = -EINVAL; retval = -EINVAL;
} }
module_put(slot->ops->owner); module_put(slot->ops->owner);
...@@ -150,24 +147,22 @@ static ssize_t attention_read_file(struct pci_slot *slot, char *buf) ...@@ -150,24 +147,22 @@ static ssize_t attention_read_file(struct pci_slot *slot, char *buf)
retval = get_attention_status(slot->hotplug, &value); retval = get_attention_status(slot->hotplug, &value);
if (retval) if (retval)
goto exit; return retval;
retval = sprintf(buf, "%d\n", value);
exit: return sprintf(buf, "%d\n", value);
return retval;
} }
static ssize_t attention_write_file(struct pci_slot *slot, const char *buf, static ssize_t attention_write_file(struct pci_slot *slot, const char *buf,
size_t count) size_t count)
{ {
struct hotplug_slot_ops *ops = slot->hotplug->ops; struct hotplug_slot_ops *ops = slot->hotplug->ops;
unsigned long lattention; unsigned long lattention;
u8 attention; u8 attention;
int retval = 0; int retval = 0;
lattention = simple_strtoul (buf, NULL, 10); lattention = simple_strtoul(buf, NULL, 10);
attention = (u8)(lattention & 0xff); attention = (u8)(lattention & 0xff);
dbg (" - attention = %d\n", attention); dbg(" - attention = %d\n", attention);
if (!try_module_get(ops->owner)) { if (!try_module_get(ops->owner)) {
retval = -ENODEV; retval = -ENODEV;
...@@ -196,11 +191,9 @@ static ssize_t latch_read_file(struct pci_slot *slot, char *buf) ...@@ -196,11 +191,9 @@ static ssize_t latch_read_file(struct pci_slot *slot, char *buf)
retval = get_latch_status(slot->hotplug, &value); retval = get_latch_status(slot->hotplug, &value);
if (retval) if (retval)
goto exit; return retval;
retval = sprintf (buf, "%d\n", value);
exit: return sprintf(buf, "%d\n", value);
return retval;
} }
static struct pci_slot_attribute hotplug_slot_attr_latch = { static struct pci_slot_attribute hotplug_slot_attr_latch = {
...@@ -215,11 +208,9 @@ static ssize_t presence_read_file(struct pci_slot *slot, char *buf) ...@@ -215,11 +208,9 @@ static ssize_t presence_read_file(struct pci_slot *slot, char *buf)
retval = get_adapter_status(slot->hotplug, &value); retval = get_adapter_status(slot->hotplug, &value);
if (retval) if (retval)
goto exit; return retval;
retval = sprintf (buf, "%d\n", value);
exit: return sprintf(buf, "%d\n", value);
return retval;
} }
static struct pci_slot_attribute hotplug_slot_attr_presence = { static struct pci_slot_attribute hotplug_slot_attr_presence = {
...@@ -228,7 +219,7 @@ static struct pci_slot_attribute hotplug_slot_attr_presence = { ...@@ -228,7 +219,7 @@ static struct pci_slot_attribute hotplug_slot_attr_presence = {
}; };
static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf, static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf,
size_t count) size_t count)
{ {
struct hotplug_slot *slot = pci_slot->hotplug; struct hotplug_slot *slot = pci_slot->hotplug;
unsigned long ltest; unsigned long ltest;
...@@ -237,7 +228,7 @@ static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf, ...@@ -237,7 +228,7 @@ static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf,
ltest = simple_strtoul (buf, NULL, 10); ltest = simple_strtoul (buf, NULL, 10);
test = (u32)(ltest & 0xffffffff); test = (u32)(ltest & 0xffffffff);
dbg ("test = %d\n", test); dbg("test = %d\n", test);
if (!try_module_get(slot->ops->owner)) { if (!try_module_get(slot->ops->owner)) {
retval = -ENODEV; retval = -ENODEV;
...@@ -261,6 +252,7 @@ static struct pci_slot_attribute hotplug_slot_attr_test = { ...@@ -261,6 +252,7 @@ static struct pci_slot_attribute hotplug_slot_attr_test = {
static bool has_power_file(struct pci_slot *pci_slot) static bool has_power_file(struct pci_slot *pci_slot)
{ {
struct hotplug_slot *slot = pci_slot->hotplug; struct hotplug_slot *slot = pci_slot->hotplug;
if ((!slot) || (!slot->ops)) if ((!slot) || (!slot->ops))
return false; return false;
if ((slot->ops->enable_slot) || if ((slot->ops->enable_slot) ||
...@@ -273,6 +265,7 @@ static bool has_power_file(struct pci_slot *pci_slot) ...@@ -273,6 +265,7 @@ static bool has_power_file(struct pci_slot *pci_slot)
static bool has_attention_file(struct pci_slot *pci_slot) static bool has_attention_file(struct pci_slot *pci_slot)
{ {
struct hotplug_slot *slot = pci_slot->hotplug; struct hotplug_slot *slot = pci_slot->hotplug;
if ((!slot) || (!slot->ops)) if ((!slot) || (!slot->ops))
return false; return false;
if ((slot->ops->set_attention_status) || if ((slot->ops->set_attention_status) ||
...@@ -284,6 +277,7 @@ static bool has_attention_file(struct pci_slot *pci_slot) ...@@ -284,6 +277,7 @@ static bool has_attention_file(struct pci_slot *pci_slot)
static bool has_latch_file(struct pci_slot *pci_slot) static bool has_latch_file(struct pci_slot *pci_slot)
{ {
struct hotplug_slot *slot = pci_slot->hotplug; struct hotplug_slot *slot = pci_slot->hotplug;
if ((!slot) || (!slot->ops)) if ((!slot) || (!slot->ops))
return false; return false;
if (slot->ops->get_latch_status) if (slot->ops->get_latch_status)
...@@ -294,6 +288,7 @@ static bool has_latch_file(struct pci_slot *pci_slot) ...@@ -294,6 +288,7 @@ static bool has_latch_file(struct pci_slot *pci_slot)
static bool has_adapter_file(struct pci_slot *pci_slot) static bool has_adapter_file(struct pci_slot *pci_slot)
{ {
struct hotplug_slot *slot = pci_slot->hotplug; struct hotplug_slot *slot = pci_slot->hotplug;
if ((!slot) || (!slot->ops)) if ((!slot) || (!slot->ops))
return false; return false;
if (slot->ops->get_adapter_status) if (slot->ops->get_adapter_status)
...@@ -304,6 +299,7 @@ static bool has_adapter_file(struct pci_slot *pci_slot) ...@@ -304,6 +299,7 @@ static bool has_adapter_file(struct pci_slot *pci_slot)
static bool has_test_file(struct pci_slot *pci_slot) static bool has_test_file(struct pci_slot *pci_slot)
{ {
struct hotplug_slot *slot = pci_slot->hotplug; struct hotplug_slot *slot = pci_slot->hotplug;
if ((!slot) || (!slot->ops)) if ((!slot) || (!slot->ops))
return false; return false;
if (slot->ops->hardware_test) if (slot->ops->hardware_test)
...@@ -397,13 +393,13 @@ static void fs_remove_slot(struct pci_slot *slot) ...@@ -397,13 +393,13 @@ static void fs_remove_slot(struct pci_slot *slot)
pci_hp_remove_module_link(slot); pci_hp_remove_module_link(slot);
} }
static struct hotplug_slot *get_slot_from_name (const char *name) static struct hotplug_slot *get_slot_from_name(const char *name)
{ {
struct hotplug_slot *slot; struct hotplug_slot *slot;
struct list_head *tmp; struct list_head *tmp;
list_for_each (tmp, &pci_hotplug_slot_list) { list_for_each(tmp, &pci_hotplug_slot_list) {
slot = list_entry (tmp, struct hotplug_slot, slot_list); slot = list_entry(tmp, struct hotplug_slot, slot_list);
if (strcmp(hotplug_slot_name(slot), name) == 0) if (strcmp(hotplug_slot_name(slot), name) == 0)
return slot; return slot;
} }
...@@ -531,23 +527,21 @@ int pci_hp_change_slot_info(struct hotplug_slot *hotplug, ...@@ -531,23 +527,21 @@ int pci_hp_change_slot_info(struct hotplug_slot *hotplug,
} }
EXPORT_SYMBOL_GPL(pci_hp_change_slot_info); EXPORT_SYMBOL_GPL(pci_hp_change_slot_info);
static int __init pci_hotplug_init (void) static int __init pci_hotplug_init(void)
{ {
int result; int result;
result = cpci_hotplug_init(debug); result = cpci_hotplug_init(debug);
if (result) { if (result) {
err ("cpci_hotplug_init with error %d\n", result); err("cpci_hotplug_init with error %d\n", result);
goto err_cpci; return result;
} }
info (DRIVER_DESC " version: " DRIVER_VERSION "\n"); info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
err_cpci:
return result; return result;
} }
static void __exit pci_hotplug_exit (void) static void __exit pci_hotplug_exit(void)
{ {
cpci_hotplug_exit(); cpci_hotplug_exit();
} }
......
...@@ -103,10 +103,10 @@ static int __init dummy_probe(struct pcie_device *dev) ...@@ -103,10 +103,10 @@ static int __init dummy_probe(struct pcie_device *dev)
} }
static struct pcie_port_service_driver __initdata dummy_driver = { static struct pcie_port_service_driver __initdata dummy_driver = {
.name = "pciehp_dummy", .name = "pciehp_dummy",
.port_type = PCIE_ANY_PORT, .port_type = PCIE_ANY_PORT,
.service = PCIE_PORT_SERVICE_HP, .service = PCIE_PORT_SERVICE_HP,
.probe = dummy_probe, .probe = dummy_probe,
}; };
static int __init select_detection_mode(void) static int __init select_detection_mode(void)
......
...@@ -312,12 +312,12 @@ static void pciehp_remove(struct pcie_device *dev) ...@@ -312,12 +312,12 @@ static void pciehp_remove(struct pcie_device *dev)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int pciehp_suspend (struct pcie_device *dev) static int pciehp_suspend(struct pcie_device *dev)
{ {
return 0; return 0;
} }
static int pciehp_resume (struct pcie_device *dev) static int pciehp_resume(struct pcie_device *dev)
{ {
struct controller *ctrl; struct controller *ctrl;
struct slot *slot; struct slot *slot;
......
...@@ -175,7 +175,7 @@ void pciehp_handle_linkstate_change(struct slot *p_slot) ...@@ -175,7 +175,7 @@ void pciehp_handle_linkstate_change(struct slot *p_slot)
hotplug controller logic hotplug controller logic
*/ */
static void set_slot_off(struct controller *ctrl, struct slot * pslot) static void set_slot_off(struct controller *ctrl, struct slot *pslot)
{ {
/* turn off slot, turn on Amber LED, turn off Green LED if supported*/ /* turn off slot, turn on Amber LED, turn off Green LED if supported*/
if (POWER_CTRL(ctrl)) { if (POWER_CTRL(ctrl)) {
......
...@@ -203,7 +203,7 @@ static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask) ...@@ -203,7 +203,7 @@ static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
if (!(slot_ctrl & PCI_EXP_SLTCTL_HPIE) || if (!(slot_ctrl & PCI_EXP_SLTCTL_HPIE) ||
!(slot_ctrl & PCI_EXP_SLTCTL_CCIE)) !(slot_ctrl & PCI_EXP_SLTCTL_CCIE))
poll = 1; poll = 1;
pcie_wait_cmd(ctrl, poll); pcie_wait_cmd(ctrl, poll);
} }
mutex_unlock(&ctrl->ctrl_lock); mutex_unlock(&ctrl->ctrl_lock);
} }
...@@ -276,15 +276,15 @@ int pciehp_check_link_status(struct controller *ctrl) ...@@ -276,15 +276,15 @@ int pciehp_check_link_status(struct controller *ctrl)
bool found; bool found;
u16 lnk_status; u16 lnk_status;
/* /*
* Data Link Layer Link Active Reporting must be capable for * Data Link Layer Link Active Reporting must be capable for
* hot-plug capable downstream port. But old controller might * hot-plug capable downstream port. But old controller might
* not implement it. In this case, we wait for 1000 ms. * not implement it. In this case, we wait for 1000 ms.
*/ */
if (ctrl->link_active_reporting) if (ctrl->link_active_reporting)
pcie_wait_link_active(ctrl); pcie_wait_link_active(ctrl);
else else
msleep(1000); msleep(1000);
/* wait 100ms before read pci conf, and try in 1s */ /* wait 100ms before read pci conf, and try in 1s */
msleep(100); msleep(100);
...@@ -295,7 +295,7 @@ int pciehp_check_link_status(struct controller *ctrl) ...@@ -295,7 +295,7 @@ int pciehp_check_link_status(struct controller *ctrl)
ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status); ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status);
if ((lnk_status & PCI_EXP_LNKSTA_LT) || if ((lnk_status & PCI_EXP_LNKSTA_LT) ||
!(lnk_status & PCI_EXP_LNKSTA_NLW)) { !(lnk_status & PCI_EXP_LNKSTA_NLW)) {
ctrl_err(ctrl, "Link Training Error occurs \n"); ctrl_err(ctrl, "Link Training Error occurs\n");
return -1; return -1;
} }
...@@ -414,7 +414,7 @@ void pciehp_set_attention_status(struct slot *slot, u8 value) ...@@ -414,7 +414,7 @@ void pciehp_set_attention_status(struct slot *slot, u8 value)
return; return;
switch (value) { switch (value) {
case 0 : /* turn off */ case 0: /* turn off */
slot_cmd = PCI_EXP_SLTCTL_ATTN_IND_OFF; slot_cmd = PCI_EXP_SLTCTL_ATTN_IND_OFF;
break; break;
case 1: /* turn on */ case 1: /* turn on */
...@@ -470,7 +470,7 @@ void pciehp_green_led_blink(struct slot *slot) ...@@ -470,7 +470,7 @@ void pciehp_green_led_blink(struct slot *slot)
PCI_EXP_SLTCTL_PWR_IND_BLINK); PCI_EXP_SLTCTL_PWR_IND_BLINK);
} }
int pciehp_power_on_slot(struct slot * slot) int pciehp_power_on_slot(struct slot *slot)
{ {
struct controller *ctrl = slot->ctrl; struct controller *ctrl = slot->ctrl;
struct pci_dev *pdev = ctrl_dev(ctrl); struct pci_dev *pdev = ctrl_dev(ctrl);
...@@ -496,7 +496,7 @@ int pciehp_power_on_slot(struct slot * slot) ...@@ -496,7 +496,7 @@ int pciehp_power_on_slot(struct slot * slot)
return retval; return retval;
} }
void pciehp_power_off_slot(struct slot * slot) void pciehp_power_off_slot(struct slot *slot)
{ {
struct controller *ctrl = slot->ctrl; struct controller *ctrl = slot->ctrl;
...@@ -756,7 +756,7 @@ static inline void dbg_ctrl(struct controller *ctrl) ...@@ -756,7 +756,7 @@ static inline void dbg_ctrl(struct controller *ctrl)
ctrl_info(ctrl, "Slot Control : 0x%04x\n", reg16); ctrl_info(ctrl, "Slot Control : 0x%04x\n", reg16);
} }
#define FLAG(x,y) (((x) & (y)) ? '+' : '-') #define FLAG(x, y) (((x) & (y)) ? '+' : '-')
struct controller *pcie_init(struct pcie_device *dev) struct controller *pcie_init(struct pcie_device *dev)
{ {
...@@ -783,14 +783,14 @@ struct controller *pcie_init(struct pcie_device *dev) ...@@ -783,14 +783,14 @@ struct controller *pcie_init(struct pcie_device *dev)
*/ */
if (NO_CMD_CMPL(ctrl) || if (NO_CMD_CMPL(ctrl) ||
!(POWER_CTRL(ctrl) | ATTN_LED(ctrl) | PWR_LED(ctrl) | EMI(ctrl))) !(POWER_CTRL(ctrl) | ATTN_LED(ctrl) | PWR_LED(ctrl) | EMI(ctrl)))
ctrl->no_cmd_complete = 1; ctrl->no_cmd_complete = 1;
/* Check if Data Link Layer Link Active Reporting is implemented */ /* Check if Data Link Layer Link Active Reporting is implemented */
pcie_capability_read_dword(pdev, PCI_EXP_LNKCAP, &link_cap); pcie_capability_read_dword(pdev, PCI_EXP_LNKCAP, &link_cap);
if (link_cap & PCI_EXP_LNKCAP_DLLLARC) { if (link_cap & PCI_EXP_LNKCAP_DLLLARC) {
ctrl_dbg(ctrl, "Link Active Reporting supported\n"); ctrl_dbg(ctrl, "Link Active Reporting supported\n");
ctrl->link_active_reporting = 1; ctrl->link_active_reporting = 1;
} }
/* Clear all remaining event bits in Slot Status register */ /* Clear all remaining event bits in Slot Status register */
pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, pcie_capability_write_word(pdev, PCI_EXP_SLTSTA,
......
...@@ -51,7 +51,7 @@ static LIST_HEAD(slot_list); ...@@ -51,7 +51,7 @@ static LIST_HEAD(slot_list);
#define dbg(format, arg...) \ #define dbg(format, arg...) \
do { \ do { \
if (debug) \ if (debug) \
printk (KERN_DEBUG "%s: " format "\n", \ printk(KERN_DEBUG "%s: " format "\n", \
MY_NAME , ## arg); \ MY_NAME , ## arg); \
} while (0) } while (0)
#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) #define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
...@@ -128,18 +128,18 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) ...@@ -128,18 +128,18 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name); dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
switch (status) { switch (status) {
case 0: case 0:
/* /*
* Fill in code here to turn light off * Fill in code here to turn light off
*/ */
break; break;
case 1: case 1:
default: default:
/* /*
* Fill in code here to turn light on * Fill in code here to turn light on
*/ */
break; break;
} }
return retval; return retval;
...@@ -153,12 +153,12 @@ static int hardware_test(struct hotplug_slot *hotplug_slot, u32 value) ...@@ -153,12 +153,12 @@ static int hardware_test(struct hotplug_slot *hotplug_slot, u32 value)
dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name); dbg("%s - physical_slot = %s\n", __func__, hotplug_slot->name);
switch (value) { switch (value) {
case 0: case 0:
/* Specify a test here */ /* Specify a test here */
break; break;
case 1: case 1:
/* Specify another test here */ /* Specify another test here */
break; break;
} }
return retval; return retval;
......
...@@ -89,7 +89,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value) ...@@ -89,7 +89,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value)
* @hotplug_slot: slot to get status * @hotplug_slot: slot to get status
* @value: pointer to store status * @value: pointer to store status
*/ */
static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
{ {
int retval, level; int retval, level;
struct slot *slot = (struct slot *)hotplug_slot->private; struct slot *slot = (struct slot *)hotplug_slot->private;
...@@ -105,14 +105,14 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) ...@@ -105,14 +105,14 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value)
* @hotplug_slot: slot to get status * @hotplug_slot: slot to get status
* @value: pointer to store status * @value: pointer to store status
*/ */
static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value) static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
{ {
struct slot *slot = (struct slot *)hotplug_slot->private; struct slot *slot = (struct slot *)hotplug_slot->private;
*value = slot->hotplug_slot->info->attention_status; *value = slot->hotplug_slot->info->attention_status;
return 0; return 0;
} }
static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value) static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
{ {
struct slot *slot = (struct slot *)hotplug_slot->private; struct slot *slot = (struct slot *)hotplug_slot->private;
int rc, state; int rc, state;
......
...@@ -188,7 +188,7 @@ static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot, ...@@ -188,7 +188,7 @@ static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot,
return 0; return 0;
} }
static struct hotplug_slot * sn_hp_destroy(void) static struct hotplug_slot *sn_hp_destroy(void)
{ {
struct slot *slot; struct slot *slot;
struct pci_slot *pci_slot; struct pci_slot *pci_slot;
......
...@@ -180,7 +180,7 @@ int shpchp_configure_device(struct slot *p_slot); ...@@ -180,7 +180,7 @@ int shpchp_configure_device(struct slot *p_slot);
int shpchp_unconfigure_device(struct slot *p_slot); int shpchp_unconfigure_device(struct slot *p_slot);
void cleanup_slots(struct controller *ctrl); void cleanup_slots(struct controller *ctrl);
void shpchp_queue_pushbutton_work(struct work_struct *work); void shpchp_queue_pushbutton_work(struct work_struct *work);
int shpc_init( struct controller *ctrl, struct pci_dev *pdev); int shpc_init(struct controller *ctrl, struct pci_dev *pdev);
static inline const char *slot_name(struct slot *slot) static inline const char *slot_name(struct slot *slot)
{ {
...@@ -295,7 +295,7 @@ static inline void amd_pogo_errata_restore_misc_reg(struct slot *p_slot) ...@@ -295,7 +295,7 @@ static inline void amd_pogo_errata_restore_misc_reg(struct slot *p_slot)
pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, rse_set); pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, rse_set);
} }
/* restore MiscII register */ /* restore MiscII register */
pci_read_config_dword( p_slot->ctrl->pci_dev, PCIX_MISCII_OFFSET, &pcix_misc2_temp ); pci_read_config_dword(p_slot->ctrl->pci_dev, PCIX_MISCII_OFFSET, &pcix_misc2_temp );
if (p_slot->ctrl->pcix_misc2_reg & SERRFATALENABLE_MASK) if (p_slot->ctrl->pcix_misc2_reg & SERRFATALENABLE_MASK)
pcix_misc2_temp |= SERRFATALENABLE_MASK; pcix_misc2_temp |= SERRFATALENABLE_MASK;
......
...@@ -162,7 +162,7 @@ u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl) ...@@ -162,7 +162,7 @@ u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl)
p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
if ( !(p_slot->hpc_ops->query_power_fault(p_slot))) { if (!(p_slot->hpc_ops->query_power_fault(p_slot))) {
/* /*
* Power fault Cleared * Power fault Cleared
*/ */
......
...@@ -404,7 +404,7 @@ static int hpc_get_attention_status(struct slot *slot, u8 *status) ...@@ -404,7 +404,7 @@ static int hpc_get_attention_status(struct slot *slot, u8 *status)
return 0; return 0;
} }
static int hpc_get_power_status(struct slot * slot, u8 *status) static int hpc_get_power_status(struct slot *slot, u8 *status)
{ {
struct controller *ctrl = slot->ctrl; struct controller *ctrl = slot->ctrl;
u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot));
...@@ -528,7 +528,7 @@ static int hpc_get_mode1_ECC_cap(struct slot *slot, u8 *mode) ...@@ -528,7 +528,7 @@ static int hpc_get_mode1_ECC_cap(struct slot *slot, u8 *mode)
return retval; return retval;
} }
static int hpc_query_power_fault(struct slot * slot) static int hpc_query_power_fault(struct slot *slot)
{ {
struct controller *ctrl = slot->ctrl; struct controller *ctrl = slot->ctrl;
u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot));
...@@ -614,7 +614,7 @@ static void hpc_release_ctlr(struct controller *ctrl) ...@@ -614,7 +614,7 @@ static void hpc_release_ctlr(struct controller *ctrl)
release_mem_region(ctrl->mmio_base, ctrl->mmio_size); release_mem_region(ctrl->mmio_base, ctrl->mmio_size);
} }
static int hpc_power_on_slot(struct slot * slot) static int hpc_power_on_slot(struct slot *slot)
{ {
int retval; int retval;
...@@ -625,7 +625,7 @@ static int hpc_power_on_slot(struct slot * slot) ...@@ -625,7 +625,7 @@ static int hpc_power_on_slot(struct slot * slot)
return retval; return retval;
} }
static int hpc_slot_enable(struct slot * slot) static int hpc_slot_enable(struct slot *slot)
{ {
int retval; int retval;
...@@ -638,7 +638,7 @@ static int hpc_slot_enable(struct slot * slot) ...@@ -638,7 +638,7 @@ static int hpc_slot_enable(struct slot * slot)
return retval; return retval;
} }
static int hpc_slot_disable(struct slot * slot) static int hpc_slot_disable(struct slot *slot)
{ {
int retval; int retval;
...@@ -720,7 +720,7 @@ static int shpc_get_cur_bus_speed(struct controller *ctrl) ...@@ -720,7 +720,7 @@ static int shpc_get_cur_bus_speed(struct controller *ctrl)
} }
static int hpc_set_bus_speed_mode(struct slot * slot, enum pci_bus_speed value) static int hpc_set_bus_speed_mode(struct slot *slot, enum pci_bus_speed value)
{ {
int retval; int retval;
struct controller *ctrl = slot->ctrl; struct controller *ctrl = slot->ctrl;
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, char *buf) static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, char *buf)
{ {
struct pci_dev *pdev; struct pci_dev *pdev;
char * out = buf; char *out = buf;
int index, busnr; int index, busnr;
struct resource *res; struct resource *res;
struct pci_bus *bus; struct pci_bus *bus;
......
...@@ -105,7 +105,7 @@ int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update) ...@@ -105,7 +105,7 @@ int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update)
spin_unlock_irqrestore(&ht_irq_lock, flags); spin_unlock_irqrestore(&ht_irq_lock, flags);
max_irq = (data >> 16) & 0xff; max_irq = (data >> 16) & 0xff;
if ( idx > max_irq) if (idx > max_irq)
return -EINVAL; return -EINVAL;
cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
......
...@@ -99,15 +99,15 @@ static void pci_free_dynids(struct pci_driver *drv) ...@@ -99,15 +99,15 @@ static void pci_free_dynids(struct pci_driver *drv)
* *
* Allow PCI IDs to be added to an existing driver via sysfs. * Allow PCI IDs to be added to an existing driver via sysfs.
*/ */
static ssize_t static ssize_t store_new_id(struct device_driver *driver, const char *buf,
store_new_id(struct device_driver *driver, const char *buf, size_t count) size_t count)
{ {
struct pci_driver *pdrv = to_pci_driver(driver); struct pci_driver *pdrv = to_pci_driver(driver);
const struct pci_device_id *ids = pdrv->id_table; const struct pci_device_id *ids = pdrv->id_table;
__u32 vendor, device, subvendor=PCI_ANY_ID, __u32 vendor, device, subvendor = PCI_ANY_ID,
subdevice=PCI_ANY_ID, class=0, class_mask=0; subdevice = PCI_ANY_ID, class = 0, class_mask = 0;
unsigned long driver_data=0; unsigned long driver_data = 0;
int fields=0; int fields = 0;
int retval = 0; int retval = 0;
fields = sscanf(buf, "%x %x %x %x %x %x %lx", fields = sscanf(buf, "%x %x %x %x %x %x %lx",
...@@ -167,8 +167,8 @@ static DRIVER_ATTR(new_id, S_IWUSR, NULL, store_new_id); ...@@ -167,8 +167,8 @@ static DRIVER_ATTR(new_id, S_IWUSR, NULL, store_new_id);
* *
* Removes a dynamic pci device ID to this driver. * Removes a dynamic pci device ID to this driver.
*/ */
static ssize_t static ssize_t store_remove_id(struct device_driver *driver, const char *buf,
store_remove_id(struct device_driver *driver, const char *buf, size_t count) size_t count)
{ {
struct pci_dynid *dynid, *n; struct pci_dynid *dynid, *n;
struct pci_driver *pdrv = to_pci_driver(driver); struct pci_driver *pdrv = to_pci_driver(driver);
...@@ -374,8 +374,7 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev, ...@@ -374,8 +374,7 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
* returns 0 on success, else error. * returns 0 on success, else error.
* side-effect: pci_dev->driver is set to drv when drv claims pci_dev. * side-effect: pci_dev->driver is set to drv when drv claims pci_dev.
*/ */
static int static int __pci_device_probe(struct pci_driver *drv, struct pci_dev *pci_dev)
__pci_device_probe(struct pci_driver *drv, struct pci_dev *pci_dev)
{ {
const struct pci_device_id *id; const struct pci_device_id *id;
int error = 0; int error = 0;
...@@ -392,7 +391,7 @@ __pci_device_probe(struct pci_driver *drv, struct pci_dev *pci_dev) ...@@ -392,7 +391,7 @@ __pci_device_probe(struct pci_driver *drv, struct pci_dev *pci_dev)
return error; return error;
} }
static int pci_device_probe(struct device * dev) static int pci_device_probe(struct device *dev)
{ {
int error = 0; int error = 0;
struct pci_driver *drv; struct pci_driver *drv;
...@@ -408,10 +407,10 @@ static int pci_device_probe(struct device * dev) ...@@ -408,10 +407,10 @@ static int pci_device_probe(struct device * dev)
return error; return error;
} }
static int pci_device_remove(struct device * dev) static int pci_device_remove(struct device *dev)
{ {
struct pci_dev * pci_dev = to_pci_dev(dev); struct pci_dev *pci_dev = to_pci_dev(dev);
struct pci_driver * drv = pci_dev->driver; struct pci_driver *drv = pci_dev->driver;
if (drv) { if (drv) {
if (drv->remove) { if (drv->remove) {
...@@ -539,8 +538,8 @@ static int pci_pm_reenable_device(struct pci_dev *pci_dev) ...@@ -539,8 +538,8 @@ static int pci_pm_reenable_device(struct pci_dev *pci_dev)
static int pci_legacy_suspend(struct device *dev, pm_message_t state) static int pci_legacy_suspend(struct device *dev, pm_message_t state)
{ {
struct pci_dev * pci_dev = to_pci_dev(dev); struct pci_dev *pci_dev = to_pci_dev(dev);
struct pci_driver * drv = pci_dev->driver; struct pci_driver *drv = pci_dev->driver;
if (drv && drv->suspend) { if (drv && drv->suspend) {
pci_power_t prev = pci_dev->current_state; pci_power_t prev = pci_dev->current_state;
...@@ -566,8 +565,8 @@ static int pci_legacy_suspend(struct device *dev, pm_message_t state) ...@@ -566,8 +565,8 @@ static int pci_legacy_suspend(struct device *dev, pm_message_t state)
static int pci_legacy_suspend_late(struct device *dev, pm_message_t state) static int pci_legacy_suspend_late(struct device *dev, pm_message_t state)
{ {
struct pci_dev * pci_dev = to_pci_dev(dev); struct pci_dev *pci_dev = to_pci_dev(dev);
struct pci_driver * drv = pci_dev->driver; struct pci_driver *drv = pci_dev->driver;
if (drv && drv->suspend_late) { if (drv && drv->suspend_late) {
pci_power_t prev = pci_dev->current_state; pci_power_t prev = pci_dev->current_state;
...@@ -597,8 +596,8 @@ static int pci_legacy_suspend_late(struct device *dev, pm_message_t state) ...@@ -597,8 +596,8 @@ static int pci_legacy_suspend_late(struct device *dev, pm_message_t state)
static int pci_legacy_resume_early(struct device *dev) static int pci_legacy_resume_early(struct device *dev)
{ {
struct pci_dev * pci_dev = to_pci_dev(dev); struct pci_dev *pci_dev = to_pci_dev(dev);
struct pci_driver * drv = pci_dev->driver; struct pci_driver *drv = pci_dev->driver;
return drv && drv->resume_early ? return drv && drv->resume_early ?
drv->resume_early(pci_dev) : 0; drv->resume_early(pci_dev) : 0;
...@@ -606,8 +605,8 @@ static int pci_legacy_resume_early(struct device *dev) ...@@ -606,8 +605,8 @@ static int pci_legacy_resume_early(struct device *dev)
static int pci_legacy_resume(struct device *dev) static int pci_legacy_resume(struct device *dev)
{ {
struct pci_dev * pci_dev = to_pci_dev(dev); struct pci_dev *pci_dev = to_pci_dev(dev);
struct pci_driver * drv = pci_dev->driver; struct pci_driver *drv = pci_dev->driver;
pci_fixup_device(pci_fixup_resume, pci_dev); pci_fixup_device(pci_fixup_resume, pci_dev);
...@@ -1269,8 +1268,7 @@ EXPORT_SYMBOL(__pci_register_driver); ...@@ -1269,8 +1268,7 @@ EXPORT_SYMBOL(__pci_register_driver);
* driverless. * driverless.
*/ */
void void pci_unregister_driver(struct pci_driver *drv)
pci_unregister_driver(struct pci_driver *drv)
{ {
driver_unregister(&drv->driver); driver_unregister(&drv->driver);
pci_free_dynids(drv); pci_free_dynids(drv);
...@@ -1288,14 +1286,13 @@ static struct pci_driver pci_compat_driver = { ...@@ -1288,14 +1286,13 @@ static struct pci_driver pci_compat_driver = {
* Returns the appropriate pci_driver structure or %NULL if there is no * Returns the appropriate pci_driver structure or %NULL if there is no
* registered driver for the device. * registered driver for the device.
*/ */
struct pci_driver * struct pci_driver *pci_dev_driver(const struct pci_dev *dev)
pci_dev_driver(const struct pci_dev *dev)
{ {
if (dev->driver) if (dev->driver)
return dev->driver; return dev->driver;
else { else {
int i; int i;
for(i=0; i<=PCI_ROM_RESOURCE; i++) for (i = 0; i <= PCI_ROM_RESOURCE; i++)
if (dev->resource[i].flags & IORESOURCE_BUSY) if (dev->resource[i].flags & IORESOURCE_BUSY)
return &pci_compat_driver; return &pci_compat_driver;
} }
......
...@@ -40,9 +40,8 @@ enum smbios_attr_enum { ...@@ -40,9 +40,8 @@ enum smbios_attr_enum {
SMBIOS_ATTR_INSTANCE_SHOW, SMBIOS_ATTR_INSTANCE_SHOW,
}; };
static size_t static size_t find_smbios_instance_string(struct pci_dev *pdev, char *buf,
find_smbios_instance_string(struct pci_dev *pdev, char *buf, enum smbios_attr_enum attribute)
enum smbios_attr_enum attribute)
{ {
const struct dmi_device *dmi; const struct dmi_device *dmi;
struct dmi_dev_onboard *donboard; struct dmi_dev_onboard *donboard;
...@@ -74,9 +73,8 @@ find_smbios_instance_string(struct pci_dev *pdev, char *buf, ...@@ -74,9 +73,8 @@ find_smbios_instance_string(struct pci_dev *pdev, char *buf,
return 0; return 0;
} }
static umode_t static umode_t smbios_instance_string_exist(struct kobject *kobj,
smbios_instance_string_exist(struct kobject *kobj, struct attribute *attr, struct attribute *attr, int n)
int n)
{ {
struct device *dev; struct device *dev;
struct pci_dev *pdev; struct pci_dev *pdev;
...@@ -88,8 +86,8 @@ smbios_instance_string_exist(struct kobject *kobj, struct attribute *attr, ...@@ -88,8 +86,8 @@ smbios_instance_string_exist(struct kobject *kobj, struct attribute *attr,
S_IRUGO : 0; S_IRUGO : 0;
} }
static ssize_t static ssize_t smbioslabel_show(struct device *dev,
smbioslabel_show(struct device *dev, struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct pci_dev *pdev; struct pci_dev *pdev;
pdev = to_pci_dev(dev); pdev = to_pci_dev(dev);
...@@ -98,9 +96,8 @@ smbioslabel_show(struct device *dev, struct device_attribute *attr, char *buf) ...@@ -98,9 +96,8 @@ smbioslabel_show(struct device *dev, struct device_attribute *attr, char *buf)
SMBIOS_ATTR_LABEL_SHOW); SMBIOS_ATTR_LABEL_SHOW);
} }
static ssize_t static ssize_t smbiosinstance_show(struct device *dev,
smbiosinstance_show(struct device *dev, struct device_attribute *attr, char *buf)
struct device_attribute *attr, char *buf)
{ {
struct pci_dev *pdev; struct pci_dev *pdev;
pdev = to_pci_dev(dev); pdev = to_pci_dev(dev);
...@@ -130,26 +127,22 @@ static struct attribute_group smbios_attr_group = { ...@@ -130,26 +127,22 @@ static struct attribute_group smbios_attr_group = {
.is_visible = smbios_instance_string_exist, .is_visible = smbios_instance_string_exist,
}; };
static int static int pci_create_smbiosname_file(struct pci_dev *pdev)
pci_create_smbiosname_file(struct pci_dev *pdev)
{ {
return sysfs_create_group(&pdev->dev.kobj, &smbios_attr_group); return sysfs_create_group(&pdev->dev.kobj, &smbios_attr_group);
} }
static void static void pci_remove_smbiosname_file(struct pci_dev *pdev)
pci_remove_smbiosname_file(struct pci_dev *pdev)
{ {
sysfs_remove_group(&pdev->dev.kobj, &smbios_attr_group); sysfs_remove_group(&pdev->dev.kobj, &smbios_attr_group);
} }
#else #else
static inline int static inline int pci_create_smbiosname_file(struct pci_dev *pdev)
pci_create_smbiosname_file(struct pci_dev *pdev)
{ {
return -1; return -1;
} }
static inline void static inline void pci_remove_smbiosname_file(struct pci_dev *pdev)
pci_remove_smbiosname_file(struct pci_dev *pdev)
{ {
} }
#endif #endif
...@@ -175,8 +168,8 @@ static void dsm_label_utf16s_to_utf8s(union acpi_object *obj, char *buf) ...@@ -175,8 +168,8 @@ static void dsm_label_utf16s_to_utf8s(union acpi_object *obj, char *buf)
buf[len] = '\n'; buf[len] = '\n';
} }
static int static int dsm_get_label(struct device *dev, char *buf,
dsm_get_label(struct device *dev, char *buf, enum acpi_attr_enum attr) enum acpi_attr_enum attr)
{ {
acpi_handle handle; acpi_handle handle;
union acpi_object *obj, *tmp; union acpi_object *obj, *tmp;
...@@ -212,8 +205,7 @@ dsm_get_label(struct device *dev, char *buf, enum acpi_attr_enum attr) ...@@ -212,8 +205,7 @@ dsm_get_label(struct device *dev, char *buf, enum acpi_attr_enum attr)
return len; return len;
} }
static bool static bool device_has_dsm(struct device *dev)
device_has_dsm(struct device *dev)
{ {
acpi_handle handle; acpi_handle handle;
...@@ -225,8 +217,8 @@ device_has_dsm(struct device *dev) ...@@ -225,8 +217,8 @@ device_has_dsm(struct device *dev)
1 << DEVICE_LABEL_DSM); 1 << DEVICE_LABEL_DSM);
} }
static umode_t static umode_t acpi_index_string_exist(struct kobject *kobj,
acpi_index_string_exist(struct kobject *kobj, struct attribute *attr, int n) struct attribute *attr, int n)
{ {
struct device *dev; struct device *dev;
...@@ -238,14 +230,14 @@ acpi_index_string_exist(struct kobject *kobj, struct attribute *attr, int n) ...@@ -238,14 +230,14 @@ acpi_index_string_exist(struct kobject *kobj, struct attribute *attr, int n)
return 0; return 0;
} }
static ssize_t static ssize_t acpilabel_show(struct device *dev,
acpilabel_show(struct device *dev, struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
return dsm_get_label(dev, buf, ACPI_ATTR_LABEL_SHOW); return dsm_get_label(dev, buf, ACPI_ATTR_LABEL_SHOW);
} }
static ssize_t static ssize_t acpiindex_show(struct device *dev,
acpiindex_show(struct device *dev, struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
return dsm_get_label(dev, buf, ACPI_ATTR_INDEX_SHOW); return dsm_get_label(dev, buf, ACPI_ATTR_INDEX_SHOW);
} }
...@@ -271,33 +263,28 @@ static struct attribute_group acpi_attr_group = { ...@@ -271,33 +263,28 @@ static struct attribute_group acpi_attr_group = {
.is_visible = acpi_index_string_exist, .is_visible = acpi_index_string_exist,
}; };
static int static int pci_create_acpi_index_label_files(struct pci_dev *pdev)
pci_create_acpi_index_label_files(struct pci_dev *pdev)
{ {
return sysfs_create_group(&pdev->dev.kobj, &acpi_attr_group); return sysfs_create_group(&pdev->dev.kobj, &acpi_attr_group);
} }
static int static int pci_remove_acpi_index_label_files(struct pci_dev *pdev)
pci_remove_acpi_index_label_files(struct pci_dev *pdev)
{ {
sysfs_remove_group(&pdev->dev.kobj, &acpi_attr_group); sysfs_remove_group(&pdev->dev.kobj, &acpi_attr_group);
return 0; return 0;
} }
#else #else
static inline int static inline int pci_create_acpi_index_label_files(struct pci_dev *pdev)
pci_create_acpi_index_label_files(struct pci_dev *pdev)
{ {
return -1; return -1;
} }
static inline int static inline int pci_remove_acpi_index_label_files(struct pci_dev *pdev)
pci_remove_acpi_index_label_files(struct pci_dev *pdev)
{ {
return -1; return -1;
} }
static inline bool static inline bool device_has_dsm(struct device *dev)
device_has_dsm(struct device *dev)
{ {
return false; return false;
} }
......
...@@ -55,7 +55,7 @@ static int __init pci_stub_init(void) ...@@ -55,7 +55,7 @@ static int __init pci_stub_init(void)
p = ids; p = ids;
while ((id = strsep(&p, ","))) { while ((id = strsep(&p, ","))) {
unsigned int vendor, device, subvendor = PCI_ANY_ID, unsigned int vendor, device, subvendor = PCI_ANY_ID,
subdevice = PCI_ANY_ID, class=0, class_mask=0; subdevice = PCI_ANY_ID, class = 0, class_mask = 0;
int fields; int fields;
if (!strlen(id)) if (!strlen(id))
......
This diff is collapsed.
...@@ -106,7 +106,7 @@ static bool pcie_ari_disabled; ...@@ -106,7 +106,7 @@ static bool pcie_ari_disabled;
* Given a PCI bus, returns the highest PCI bus number present in the set * Given a PCI bus, returns the highest PCI bus number present in the set
* including the given PCI bus and its list of child PCI buses. * including the given PCI bus and its list of child PCI buses.
*/ */
unsigned char pci_bus_max_busnr(struct pci_bus* bus) unsigned char pci_bus_max_busnr(struct pci_bus *bus)
{ {
struct pci_bus *tmp; struct pci_bus *tmp;
unsigned char max, n; unsigned char max, n;
...@@ -114,7 +114,7 @@ unsigned char pci_bus_max_busnr(struct pci_bus* bus) ...@@ -114,7 +114,7 @@ unsigned char pci_bus_max_busnr(struct pci_bus* bus)
max = bus->busn_res.end; max = bus->busn_res.end;
list_for_each_entry(tmp, &bus->children, node) { list_for_each_entry(tmp, &bus->children, node) {
n = pci_bus_max_busnr(tmp); n = pci_bus_max_busnr(tmp);
if(n > max) if (n > max)
max = n; max = n;
} }
return max; return max;
...@@ -405,8 +405,8 @@ EXPORT_SYMBOL_GPL(pci_find_ht_capability); ...@@ -405,8 +405,8 @@ EXPORT_SYMBOL_GPL(pci_find_ht_capability);
* For given resource region of given device, return the resource * For given resource region of given device, return the resource
* region of parent bus the given region is contained in. * region of parent bus the given region is contained in.
*/ */
struct resource * struct resource *pci_find_parent_resource(const struct pci_dev *dev,
pci_find_parent_resource(const struct pci_dev *dev, struct resource *res) struct resource *res)
{ {
const struct pci_bus *bus = dev->bus; const struct pci_bus *bus = dev->bus;
struct resource *r; struct resource *r;
...@@ -473,8 +473,7 @@ int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask) ...@@ -473,8 +473,7 @@ int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask)
* Restore the BAR values for a given device, so as to make it * Restore the BAR values for a given device, so as to make it
* accessible by its driver. * accessible by its driver.
*/ */
static void static void pci_restore_bars(struct pci_dev *dev)
pci_restore_bars(struct pci_dev *dev)
{ {
int i; int i;
...@@ -499,7 +498,7 @@ static inline bool platform_pci_power_manageable(struct pci_dev *dev) ...@@ -499,7 +498,7 @@ static inline bool platform_pci_power_manageable(struct pci_dev *dev)
} }
static inline int platform_pci_set_power_state(struct pci_dev *dev, static inline int platform_pci_set_power_state(struct pci_dev *dev,
pci_power_t t) pci_power_t t)
{ {
return pci_platform_pm ? pci_platform_pm->set_state(dev, t) : -ENOSYS; return pci_platform_pm ? pci_platform_pm->set_state(dev, t) : -ENOSYS;
} }
...@@ -888,12 +887,10 @@ pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) ...@@ -888,12 +887,10 @@ pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state)
} }
return PCI_D0; return PCI_D0;
} }
EXPORT_SYMBOL(pci_choose_state); EXPORT_SYMBOL(pci_choose_state);
#define PCI_EXP_SAVE_REGS 7 #define PCI_EXP_SAVE_REGS 7
static struct pci_cap_saved_state *_pci_find_saved_cap(struct pci_dev *pci_dev, static struct pci_cap_saved_state *_pci_find_saved_cap(struct pci_dev *pci_dev,
u16 cap, bool extended) u16 cap, bool extended)
{ {
...@@ -1005,8 +1002,7 @@ static void pci_restore_pcix_state(struct pci_dev *dev) ...@@ -1005,8 +1002,7 @@ static void pci_restore_pcix_state(struct pci_dev *dev)
* pci_save_state - save the PCI configuration space of a device before suspending * pci_save_state - save the PCI configuration space of a device before suspending
* @dev: - PCI device that we're dealing with * @dev: - PCI device that we're dealing with
*/ */
int int pci_save_state(struct pci_dev *dev)
pci_save_state(struct pci_dev *dev)
{ {
int i; int i;
/* XXX: 100% dword access ok here? */ /* XXX: 100% dword access ok here? */
...@@ -1381,7 +1377,7 @@ static void pcim_release(struct device *gendev, void *res) ...@@ -1381,7 +1377,7 @@ static void pcim_release(struct device *gendev, void *res)
pci_disable_device(dev); pci_disable_device(dev);
} }
static struct pci_devres * get_pci_dr(struct pci_dev *pdev) static struct pci_devres *get_pci_dr(struct pci_dev *pdev)
{ {
struct pci_devres *dr, *new_dr; struct pci_devres *dr, *new_dr;
...@@ -1395,7 +1391,7 @@ static struct pci_devres * get_pci_dr(struct pci_dev *pdev) ...@@ -1395,7 +1391,7 @@ static struct pci_devres * get_pci_dr(struct pci_dev *pdev)
return devres_get(&pdev->dev, new_dr, NULL, NULL); return devres_get(&pdev->dev, new_dr, NULL, NULL);
} }
static struct pci_devres * find_pci_dr(struct pci_dev *pdev) static struct pci_devres *find_pci_dr(struct pci_dev *pdev)
{ {
if (pci_is_managed(pdev)) if (pci_is_managed(pdev))
return devres_find(&pdev->dev, pcim_release, NULL, NULL); return devres_find(&pdev->dev, pcim_release, NULL, NULL);
...@@ -1455,7 +1451,7 @@ EXPORT_SYMBOL(pcim_pin_device); ...@@ -1455,7 +1451,7 @@ EXPORT_SYMBOL(pcim_pin_device);
* devices are added. This is the default implementation. Architecture * devices are added. This is the default implementation. Architecture
* implementations can override this. * implementations can override this.
*/ */
int __weak pcibios_add_device (struct pci_dev *dev) int __weak pcibios_add_device(struct pci_dev *dev)
{ {
return 0; return 0;
} }
...@@ -1527,8 +1523,7 @@ void pci_disable_enabled_device(struct pci_dev *dev) ...@@ -1527,8 +1523,7 @@ void pci_disable_enabled_device(struct pci_dev *dev)
* Note we don't actually disable the device until all callers of * Note we don't actually disable the device until all callers of
* pci_enable_device() have called pci_disable_device(). * pci_enable_device() have called pci_disable_device().
*/ */
void void pci_disable_device(struct pci_dev *dev)
pci_disable_device(struct pci_dev *dev)
{ {
struct pci_devres *dr; struct pci_devres *dr;
...@@ -2434,8 +2429,7 @@ u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin) ...@@ -2434,8 +2429,7 @@ u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin)
return (((pin - 1) + slot) % 4) + 1; return (((pin - 1) + slot) % 4) + 1;
} }
int int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge)
pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge)
{ {
u8 pin; u8 pin;
...@@ -2518,8 +2512,8 @@ EXPORT_SYMBOL(pci_release_region); ...@@ -2518,8 +2512,8 @@ EXPORT_SYMBOL(pci_release_region);
* Returns 0 on success, or %EBUSY on error. A warning * Returns 0 on success, or %EBUSY on error. A warning
* message is also printed on failure. * message is also printed on failure.
*/ */
static int __pci_request_region(struct pci_dev *pdev, int bar, const char *res_name, static int __pci_request_region(struct pci_dev *pdev, int bar,
int exclusive) const char *res_name, int exclusive)
{ {
struct pci_devres *dr; struct pci_devres *dr;
...@@ -2530,8 +2524,7 @@ static int __pci_request_region(struct pci_dev *pdev, int bar, const char *res_n ...@@ -2530,8 +2524,7 @@ static int __pci_request_region(struct pci_dev *pdev, int bar, const char *res_n
if (!request_region(pci_resource_start(pdev, bar), if (!request_region(pci_resource_start(pdev, bar),
pci_resource_len(pdev, bar), res_name)) pci_resource_len(pdev, bar), res_name))
goto err_out; goto err_out;
} } else if (pci_resource_flags(pdev, bar) & IORESOURCE_MEM) {
else if (pci_resource_flags(pdev, bar) & IORESOURCE_MEM) {
if (!__request_mem_region(pci_resource_start(pdev, bar), if (!__request_mem_region(pci_resource_start(pdev, bar),
pci_resource_len(pdev, bar), res_name, pci_resource_len(pdev, bar), res_name,
exclusive)) exclusive))
...@@ -2588,7 +2581,8 @@ EXPORT_SYMBOL(pci_request_region); ...@@ -2588,7 +2581,8 @@ EXPORT_SYMBOL(pci_request_region);
* explicitly not allowed to map the resource via /dev/mem or * explicitly not allowed to map the resource via /dev/mem or
* sysfs. * sysfs.
*/ */
int pci_request_region_exclusive(struct pci_dev *pdev, int bar, const char *res_name) int pci_request_region_exclusive(struct pci_dev *pdev, int bar,
const char *res_name)
{ {
return __pci_request_region(pdev, bar, res_name, IORESOURCE_EXCLUSIVE); return __pci_request_region(pdev, bar, res_name, IORESOURCE_EXCLUSIVE);
} }
...@@ -2613,7 +2607,7 @@ void pci_release_selected_regions(struct pci_dev *pdev, int bars) ...@@ -2613,7 +2607,7 @@ void pci_release_selected_regions(struct pci_dev *pdev, int bars)
EXPORT_SYMBOL(pci_release_selected_regions); EXPORT_SYMBOL(pci_release_selected_regions);
static int __pci_request_selected_regions(struct pci_dev *pdev, int bars, static int __pci_request_selected_regions(struct pci_dev *pdev, int bars,
const char *res_name, int excl) const char *res_name, int excl)
{ {
int i; int i;
...@@ -2624,7 +2618,7 @@ static int __pci_request_selected_regions(struct pci_dev *pdev, int bars, ...@@ -2624,7 +2618,7 @@ static int __pci_request_selected_regions(struct pci_dev *pdev, int bars,
return 0; return 0;
err_out: err_out:
while(--i >= 0) while (--i >= 0)
if (bars & (1 << i)) if (bars & (1 << i))
pci_release_region(pdev, i); pci_release_region(pdev, i);
...@@ -2645,8 +2639,8 @@ int pci_request_selected_regions(struct pci_dev *pdev, int bars, ...@@ -2645,8 +2639,8 @@ int pci_request_selected_regions(struct pci_dev *pdev, int bars,
} }
EXPORT_SYMBOL(pci_request_selected_regions); EXPORT_SYMBOL(pci_request_selected_regions);
int pci_request_selected_regions_exclusive(struct pci_dev *pdev, int pci_request_selected_regions_exclusive(struct pci_dev *pdev, int bars,
int bars, const char *res_name) const char *res_name)
{ {
return __pci_request_selected_regions(pdev, bars, res_name, return __pci_request_selected_regions(pdev, bars, res_name,
IORESOURCE_EXCLUSIVE); IORESOURCE_EXCLUSIVE);
...@@ -2836,8 +2830,7 @@ EXPORT_SYMBOL_GPL(pci_set_cacheline_size); ...@@ -2836,8 +2830,7 @@ EXPORT_SYMBOL_GPL(pci_set_cacheline_size);
* *
* RETURNS: An appropriate -ERRNO error value on error, or zero for success. * RETURNS: An appropriate -ERRNO error value on error, or zero for success.
*/ */
int int pci_set_mwi(struct pci_dev *dev)
pci_set_mwi(struct pci_dev *dev)
{ {
#ifdef PCI_DISABLE_MWI #ifdef PCI_DISABLE_MWI
return 0; return 0;
...@@ -2850,7 +2843,7 @@ pci_set_mwi(struct pci_dev *dev) ...@@ -2850,7 +2843,7 @@ pci_set_mwi(struct pci_dev *dev)
return rc; return rc;
pci_read_config_word(dev, PCI_COMMAND, &cmd); pci_read_config_word(dev, PCI_COMMAND, &cmd);
if (! (cmd & PCI_COMMAND_INVALIDATE)) { if (!(cmd & PCI_COMMAND_INVALIDATE)) {
dev_dbg(&dev->dev, "enabling Mem-Wr-Inval\n"); dev_dbg(&dev->dev, "enabling Mem-Wr-Inval\n");
cmd |= PCI_COMMAND_INVALIDATE; cmd |= PCI_COMMAND_INVALIDATE;
pci_write_config_word(dev, PCI_COMMAND, cmd); pci_write_config_word(dev, PCI_COMMAND, cmd);
...@@ -2885,8 +2878,7 @@ EXPORT_SYMBOL(pci_try_set_mwi); ...@@ -2885,8 +2878,7 @@ EXPORT_SYMBOL(pci_try_set_mwi);
* *
* Disables PCI Memory-Write-Invalidate transaction on the device * Disables PCI Memory-Write-Invalidate transaction on the device
*/ */
void void pci_clear_mwi(struct pci_dev *dev)
pci_clear_mwi(struct pci_dev *dev)
{ {
#ifndef PCI_DISABLE_MWI #ifndef PCI_DISABLE_MWI
u16 cmd; u16 cmd;
...@@ -2907,18 +2899,16 @@ EXPORT_SYMBOL(pci_clear_mwi); ...@@ -2907,18 +2899,16 @@ EXPORT_SYMBOL(pci_clear_mwi);
* *
* Enables/disables PCI INTx for device dev * Enables/disables PCI INTx for device dev
*/ */
void void pci_intx(struct pci_dev *pdev, int enable)
pci_intx(struct pci_dev *pdev, int enable)
{ {
u16 pci_command, new; u16 pci_command, new;
pci_read_config_word(pdev, PCI_COMMAND, &pci_command); pci_read_config_word(pdev, PCI_COMMAND, &pci_command);
if (enable) { if (enable)
new = pci_command & ~PCI_COMMAND_INTX_DISABLE; new = pci_command & ~PCI_COMMAND_INTX_DISABLE;
} else { else
new = pci_command | PCI_COMMAND_INTX_DISABLE; new = pci_command | PCI_COMMAND_INTX_DISABLE;
}
if (new != pci_command) { if (new != pci_command) {
struct pci_devres *dr; struct pci_devres *dr;
...@@ -4159,7 +4149,7 @@ void __init pci_register_set_vga_state(arch_set_vga_state_t func) ...@@ -4159,7 +4149,7 @@ void __init pci_register_set_vga_state(arch_set_vga_state_t func)
} }
static int pci_set_vga_state_arch(struct pci_dev *dev, bool decode, static int pci_set_vga_state_arch(struct pci_dev *dev, bool decode,
unsigned int command_bits, u32 flags) unsigned int command_bits, u32 flags)
{ {
if (arch_set_vga_state) if (arch_set_vga_state)
return arch_set_vga_state(dev, decode, command_bits, return arch_set_vga_state(dev, decode, command_bits,
...@@ -4271,11 +4261,10 @@ static resource_size_t pci_specified_resource_alignment(struct pci_dev *dev) ...@@ -4271,11 +4261,10 @@ static resource_size_t pci_specified_resource_alignment(struct pci_dev *dev)
bus == dev->bus->number && bus == dev->bus->number &&
slot == PCI_SLOT(dev->devfn) && slot == PCI_SLOT(dev->devfn) &&
func == PCI_FUNC(dev->devfn)) { func == PCI_FUNC(dev->devfn)) {
if (align_order == -1) { if (align_order == -1)
align = PAGE_SIZE; align = PAGE_SIZE;
} else { else
align = 1 << align_order; align = 1 << align_order;
}
/* Found */ /* Found */
break; break;
} }
...@@ -4393,7 +4382,6 @@ static int __init pci_resource_alignment_sysfs_init(void) ...@@ -4393,7 +4382,6 @@ static int __init pci_resource_alignment_sysfs_init(void)
return bus_create_file(&pci_bus_type, return bus_create_file(&pci_bus_type,
&bus_attr_resource_alignment); &bus_attr_resource_alignment);
} }
late_initcall(pci_resource_alignment_sysfs_init); late_initcall(pci_resource_alignment_sysfs_init);
static void pci_no_domains(void) static void pci_no_domains(void)
......
...@@ -464,8 +464,7 @@ static int aer_inject(struct aer_error_inj *einj) ...@@ -464,8 +464,7 @@ static int aer_inject(struct aer_error_inj *einj)
goto out_put; goto out_put;
} }
aer_irq(-1, edev); aer_irq(-1, edev);
} } else
else
ret = -EINVAL; ret = -EINVAL;
out_put: out_put:
kfree(err_alloc); kfree(err_alloc);
......
...@@ -542,8 +542,7 @@ static void aer_recover_work_func(struct work_struct *work); ...@@ -542,8 +542,7 @@ static void aer_recover_work_func(struct work_struct *work);
#define AER_RECOVER_RING_ORDER 4 #define AER_RECOVER_RING_ORDER 4
#define AER_RECOVER_RING_SIZE (1 << AER_RECOVER_RING_ORDER) #define AER_RECOVER_RING_SIZE (1 << AER_RECOVER_RING_ORDER)
struct aer_recover_entry struct aer_recover_entry {
{
u8 bus; u8 bus;
u8 devfn; u8 devfn;
u16 domain; u16 domain;
......
...@@ -168,7 +168,7 @@ static inline unsigned long decode_bar(struct pci_dev *dev, u32 bar) ...@@ -168,7 +168,7 @@ static inline unsigned long decode_bar(struct pci_dev *dev, u32 bar)
* Returns 1 if the BAR is 64-bit, or 0 if 32-bit. * Returns 1 if the BAR is 64-bit, or 0 if 32-bit.
*/ */
int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
struct resource *res, unsigned int pos) struct resource *res, unsigned int pos)
{ {
u32 l, sz, mask; u32 l, sz, mask;
u64 l64, sz64, mask64; u64 l64, sz64, mask64;
...@@ -604,7 +604,6 @@ static enum pci_bus_speed agp_speed(int agp3, int agpstat) ...@@ -604,7 +604,6 @@ static enum pci_bus_speed agp_speed(int agp3, int agpstat)
return agp_speeds[index]; return agp_speeds[index];
} }
static void pci_set_bus_speed(struct pci_bus *bus) static void pci_set_bus_speed(struct pci_bus *bus)
{ {
struct pci_dev *bridge = bus->self; struct pci_dev *bridge = bus->self;
...@@ -636,11 +635,10 @@ static void pci_set_bus_speed(struct pci_bus *bus) ...@@ -636,11 +635,10 @@ static void pci_set_bus_speed(struct pci_bus *bus)
} else if (status & PCI_X_SSTATUS_266MHZ) { } else if (status & PCI_X_SSTATUS_266MHZ) {
max = PCI_SPEED_133MHz_PCIX_266; max = PCI_SPEED_133MHz_PCIX_266;
} else if (status & PCI_X_SSTATUS_133MHZ) { } else if (status & PCI_X_SSTATUS_133MHZ) {
if ((status & PCI_X_SSTATUS_VERS) == PCI_X_SSTATUS_V2) { if ((status & PCI_X_SSTATUS_VERS) == PCI_X_SSTATUS_V2)
max = PCI_SPEED_133MHz_PCIX_ECC; max = PCI_SPEED_133MHz_PCIX_ECC;
} else { else
max = PCI_SPEED_133MHz_PCIX; max = PCI_SPEED_133MHz_PCIX;
}
} else { } else {
max = PCI_SPEED_66MHz_PCIX; max = PCI_SPEED_66MHz_PCIX;
} }
...@@ -664,7 +662,6 @@ static void pci_set_bus_speed(struct pci_bus *bus) ...@@ -664,7 +662,6 @@ static void pci_set_bus_speed(struct pci_bus *bus)
} }
} }
static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent, static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent,
struct pci_dev *bridge, int busnr) struct pci_dev *bridge, int busnr)
{ {
...@@ -729,7 +726,8 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent, ...@@ -729,7 +726,8 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent,
return child; return child;
} }
struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr) struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
int busnr)
{ {
struct pci_bus *child; struct pci_bus *child;
...@@ -888,7 +886,7 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass) ...@@ -888,7 +886,7 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
* as cards with a PCI-to-PCI bridge can be * as cards with a PCI-to-PCI bridge can be
* inserted later. * inserted later.
*/ */
for (i=0; i<CARDBUS_RESERVE_BUSNR; i++) { for (i = 0; i < CARDBUS_RESERVE_BUSNR; i++) {
struct pci_bus *parent = bus; struct pci_bus *parent = bus;
if (pci_find_bus(pci_domain_nr(bus), if (pci_find_bus(pci_domain_nr(bus),
max+i+1)) max+i+1))
...@@ -994,7 +992,6 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev) ...@@ -994,7 +992,6 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev)
pdev->is_hotplug_bridge = 1; pdev->is_hotplug_bridge = 1;
} }
/** /**
* pci_ext_cfg_is_aliased - is ext config space just an alias of std config? * pci_ext_cfg_is_aliased - is ext config space just an alias of std config?
* @dev: PCI device * @dev: PCI device
...@@ -1285,7 +1282,7 @@ struct pci_dev *pci_alloc_dev(struct pci_bus *bus) ...@@ -1285,7 +1282,7 @@ struct pci_dev *pci_alloc_dev(struct pci_bus *bus)
EXPORT_SYMBOL(pci_alloc_dev); EXPORT_SYMBOL(pci_alloc_dev);
bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l, bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l,
int crs_timeout) int crs_timeout)
{ {
int delay = 1; int delay = 1;
...@@ -1719,7 +1716,7 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus) ...@@ -1719,7 +1716,7 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus)
bus->is_added = 1; bus->is_added = 1;
} }
for (pass=0; pass < 2; pass++) for (pass = 0; pass < 2; pass++)
list_for_each_entry(dev, &bus->devices, bus_list) { list_for_each_entry(dev, &bus->devices, bus_list) {
if (pci_is_bridge(dev)) if (pci_is_bridge(dev))
max = pci_scan_bridge(bus, dev, max, pass); max = pci_scan_bridge(bus, dev, max, pass);
...@@ -2062,7 +2059,8 @@ void pci_unlock_rescan_remove(void) ...@@ -2062,7 +2059,8 @@ void pci_unlock_rescan_remove(void)
} }
EXPORT_SYMBOL_GPL(pci_unlock_rescan_remove); EXPORT_SYMBOL_GPL(pci_unlock_rescan_remove);
static int __init pci_sort_bf_cmp(const struct device *d_a, const struct device *d_b) static int __init pci_sort_bf_cmp(const struct device *d_a,
const struct device *d_b)
{ {
const struct pci_dev *a = to_pci_dev(d_a); const struct pci_dev *a = to_pci_dev(d_a);
const struct pci_dev *b = to_pci_dev(d_b); const struct pci_dev *b = to_pci_dev(d_b);
......
...@@ -17,15 +17,14 @@ ...@@ -17,15 +17,14 @@
static int proc_initialized; /* = 0 */ static int proc_initialized; /* = 0 */
static loff_t static loff_t proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
proc_bus_pci_lseek(struct file *file, loff_t off, int whence)
{ {
struct pci_dev *dev = PDE_DATA(file_inode(file)); struct pci_dev *dev = PDE_DATA(file_inode(file));
return fixed_size_llseek(file, off, whence, dev->cfg_size); return fixed_size_llseek(file, off, whence, dev->cfg_size);
} }
static ssize_t static ssize_t proc_bus_pci_read(struct file *file, char __user *buf,
proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) size_t nbytes, loff_t *ppos)
{ {
struct pci_dev *dev = PDE_DATA(file_inode(file)); struct pci_dev *dev = PDE_DATA(file_inode(file));
unsigned int pos = *ppos; unsigned int pos = *ppos;
...@@ -108,8 +107,8 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp ...@@ -108,8 +107,8 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
return nbytes; return nbytes;
} }
static ssize_t static ssize_t proc_bus_pci_write(struct file *file, const char __user *buf,
proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, loff_t *ppos) size_t nbytes, loff_t *ppos)
{ {
struct inode *ino = file_inode(file); struct inode *ino = file_inode(file);
struct pci_dev *dev = PDE_DATA(ino); struct pci_dev *dev = PDE_DATA(ino);
...@@ -413,7 +412,7 @@ int pci_proc_detach_device(struct pci_dev *dev) ...@@ -413,7 +412,7 @@ int pci_proc_detach_device(struct pci_dev *dev)
return 0; return 0;
} }
int pci_proc_detach_bus(struct pci_bus* bus) int pci_proc_detach_bus(struct pci_bus *bus)
{ {
proc_remove(bus->procdir); proc_remove(bus->procdir);
return 0; return 0;
...@@ -423,6 +422,7 @@ static int proc_bus_pci_dev_open(struct inode *inode, struct file *file) ...@@ -423,6 +422,7 @@ static int proc_bus_pci_dev_open(struct inode *inode, struct file *file)
{ {
return seq_open(file, &proc_bus_pci_devices_op); return seq_open(file, &proc_bus_pci_devices_op);
} }
static const struct file_operations proc_bus_pci_dev_operations = { static const struct file_operations proc_bus_pci_dev_operations = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = proc_bus_pci_dev_open, .open = proc_bus_pci_dev_open,
...@@ -443,6 +443,4 @@ static int __init pci_proc_init(void) ...@@ -443,6 +443,4 @@ static int __init pci_proc_init(void)
return 0; return 0;
} }
device_initcall(pci_proc_init); device_initcall(pci_proc_init);
This diff is collapsed.
...@@ -137,7 +137,7 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) ...@@ -137,7 +137,7 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
} else { } else {
/* assign the ROM an address if it doesn't have one */ /* assign the ROM an address if it doesn't have one */
if (res->parent == NULL && if (res->parent == NULL &&
pci_assign_resource(pdev,PCI_ROM_RESOURCE)) pci_assign_resource(pdev, PCI_ROM_RESOURCE))
return NULL; return NULL;
start = pci_resource_start(pdev, PCI_ROM_RESOURCE); start = pci_resource_start(pdev, PCI_ROM_RESOURCE);
*size = pci_resource_len(pdev, PCI_ROM_RESOURCE); *size = pci_resource_len(pdev, PCI_ROM_RESOURCE);
...@@ -203,7 +203,7 @@ void pci_cleanup_rom(struct pci_dev *pdev) ...@@ -203,7 +203,7 @@ void pci_cleanup_rom(struct pci_dev *pdev)
struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
if (res->flags & IORESOURCE_ROM_COPY) { if (res->flags & IORESOURCE_ROM_COPY) {
kfree((void*)(unsigned long)res->start); kfree((void *)(unsigned long)res->start);
res->flags |= IORESOURCE_UNSET; res->flags |= IORESOURCE_UNSET;
res->flags &= ~IORESOURCE_ROM_COPY; res->flags &= ~IORESOURCE_ROM_COPY;
res->start = 0; res->start = 0;
......
...@@ -110,8 +110,7 @@ int pci_for_each_dma_alias(struct pci_dev *pdev, ...@@ -110,8 +110,7 @@ int pci_for_each_dma_alias(struct pci_dev *pdev,
* legacy PCI bridge and the bridge is directly connected to bus 0), return its * legacy PCI bridge and the bridge is directly connected to bus 0), return its
* parent * parent
*/ */
struct pci_dev * struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev)
pci_find_upstream_pcie_bridge(struct pci_dev *pdev)
{ {
struct pci_dev *tmp = NULL; struct pci_dev *tmp = NULL;
...@@ -143,12 +142,12 @@ static struct pci_bus *pci_do_find_bus(struct pci_bus *bus, unsigned char busnr) ...@@ -143,12 +142,12 @@ static struct pci_bus *pci_do_find_bus(struct pci_bus *bus, unsigned char busnr)
struct pci_bus *child; struct pci_bus *child;
struct pci_bus *tmp; struct pci_bus *tmp;
if(bus->number == busnr) if (bus->number == busnr)
return bus; return bus;
list_for_each_entry(tmp, &bus->children, node) { list_for_each_entry(tmp, &bus->children, node) {
child = pci_do_find_bus(tmp, busnr); child = pci_do_find_bus(tmp, busnr);
if(child) if (child)
return child; return child;
} }
return NULL; return NULL;
...@@ -163,7 +162,7 @@ static struct pci_bus *pci_do_find_bus(struct pci_bus *bus, unsigned char busnr) ...@@ -163,7 +162,7 @@ static struct pci_bus *pci_do_find_bus(struct pci_bus *bus, unsigned char busnr)
* in the global list of PCI buses. If the bus is found, a pointer to its * in the global list of PCI buses. If the bus is found, a pointer to its
* data structure is returned. If no bus is found, %NULL is returned. * data structure is returned. If no bus is found, %NULL is returned.
*/ */
struct pci_bus * pci_find_bus(int domain, int busnr) struct pci_bus *pci_find_bus(int domain, int busnr)
{ {
struct pci_bus *bus = NULL; struct pci_bus *bus = NULL;
struct pci_bus *tmp_bus; struct pci_bus *tmp_bus;
...@@ -188,8 +187,7 @@ EXPORT_SYMBOL(pci_find_bus); ...@@ -188,8 +187,7 @@ EXPORT_SYMBOL(pci_find_bus);
* @from is not %NULL, searches continue from next device on the * @from is not %NULL, searches continue from next device on the
* global list. * global list.
*/ */
struct pci_bus * struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
pci_find_next_bus(const struct pci_bus *from)
{ {
struct list_head *n; struct list_head *n;
struct pci_bus *b = NULL; struct pci_bus *b = NULL;
...@@ -357,8 +355,8 @@ EXPORT_SYMBOL(pci_get_subsys); ...@@ -357,8 +355,8 @@ EXPORT_SYMBOL(pci_get_subsys);
* from next device on the global list. The reference count for @from is * from next device on the global list. The reference count for @from is
* always decremented if it is not %NULL. * always decremented if it is not %NULL.
*/ */
struct pci_dev * struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
pci_get_device(unsigned int vendor, unsigned int device, struct pci_dev *from) struct pci_dev *from)
{ {
return pci_get_subsys(vendor, device, PCI_ANY_ID, PCI_ANY_ID, from); return pci_get_subsys(vendor, device, PCI_ANY_ID, PCI_ANY_ID, from);
} }
......
...@@ -68,7 +68,7 @@ static int add_to_list(struct list_head *head, ...@@ -68,7 +68,7 @@ static int add_to_list(struct list_head *head,
tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
if (!tmp) { if (!tmp) {
pr_warning("add_to_list: kmalloc() failed!\n"); pr_warn("add_to_list: kmalloc() failed!\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -736,7 +736,7 @@ static resource_size_t calculate_iosize(resource_size_t size, ...@@ -736,7 +736,7 @@ static resource_size_t calculate_iosize(resource_size_t size,
{ {
if (size < min_size) if (size < min_size)
size = min_size; size = min_size;
if (old_size == 1 ) if (old_size == 1)
old_size = 0; old_size = 0;
/* To be fixed in 2.5: we should have sort of HAVE_ISA /* To be fixed in 2.5: we should have sort of HAVE_ISA
flag in the struct pci_bus. */ flag in the struct pci_bus. */
...@@ -757,7 +757,7 @@ static resource_size_t calculate_memsize(resource_size_t size, ...@@ -757,7 +757,7 @@ static resource_size_t calculate_memsize(resource_size_t size,
{ {
if (size < min_size) if (size < min_size)
size = min_size; size = min_size;
if (old_size == 1 ) if (old_size == 1)
old_size = 0; old_size = 0;
if (size < old_size) if (size < old_size)
size = old_size; size = old_size;
...@@ -1430,10 +1430,10 @@ static void pci_bus_dump_res(struct pci_bus *bus) ...@@ -1430,10 +1430,10 @@ static void pci_bus_dump_res(struct pci_bus *bus)
pci_bus_for_each_resource(bus, res, i) { pci_bus_for_each_resource(bus, res, i) {
if (!res || !res->end || !res->flags) if (!res || !res->end || !res->flags)
continue; continue;
dev_printk(KERN_DEBUG, &bus->dev, "resource %d %pR\n", i, res); dev_printk(KERN_DEBUG, &bus->dev, "resource %d %pR\n", i, res);
} }
} }
static void pci_bus_dump_resources(struct pci_bus *bus) static void pci_bus_dump_resources(struct pci_bus *bus)
...@@ -1458,7 +1458,7 @@ static int pci_bus_get_depth(struct pci_bus *bus) ...@@ -1458,7 +1458,7 @@ static int pci_bus_get_depth(struct pci_bus *bus)
int depth = 0; int depth = 0;
struct pci_bus *child_bus; struct pci_bus *child_bus;
list_for_each_entry(child_bus, &bus->children, node){ list_for_each_entry(child_bus, &bus->children, node) {
int ret; int ret;
ret = pci_bus_get_depth(child_bus); ret = pci_bus_get_depth(child_bus);
......
...@@ -22,10 +22,9 @@ void __weak pcibios_update_irq(struct pci_dev *dev, int irq) ...@@ -22,10 +22,9 @@ void __weak pcibios_update_irq(struct pci_dev *dev, int irq)
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
} }
static void static void pdev_fixup_irq(struct pci_dev *dev,
pdev_fixup_irq(struct pci_dev *dev, u8 (*swizzle)(struct pci_dev *, u8 *),
u8 (*swizzle)(struct pci_dev *, u8 *), int (*map_irq)(const struct pci_dev *, u8, u8))
int (*map_irq)(const struct pci_dev *, u8, u8))
{ {
u8 pin, slot; u8 pin, slot;
int irq = 0; int irq = 0;
...@@ -58,11 +57,11 @@ pdev_fixup_irq(struct pci_dev *dev, ...@@ -58,11 +57,11 @@ pdev_fixup_irq(struct pci_dev *dev,
pcibios_update_irq(dev, irq); pcibios_update_irq(dev, irq);
} }
void void pci_fixup_irqs(u8 (*swizzle)(struct pci_dev *, u8 *),
pci_fixup_irqs(u8 (*swizzle)(struct pci_dev *, u8 *), int (*map_irq)(const struct pci_dev *, u8, u8))
int (*map_irq)(const struct pci_dev *, u8, u8))
{ {
struct pci_dev *dev = NULL; struct pci_dev *dev = NULL;
for_each_pci_dev(dev) for_each_pci_dev(dev)
pdev_fixup_irq(dev, swizzle, map_irq); pdev_fixup_irq(dev, swizzle, map_irq);
} }
...@@ -99,7 +99,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn, ...@@ -99,7 +99,7 @@ SYSCALL_DEFINE5(pciconfig_write, unsigned long, bus, unsigned long, dfn,
if (!dev) if (!dev)
return -ENODEV; return -ENODEV;
switch(len) { switch (len) {
case 1: case 1:
err = get_user(byte, (u8 __user *)buf); err = get_user(byte, (u8 __user *)buf);
if (err) if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment