>From 1d65b0ab958f2af1ecba77c491c3c96f860e82c7 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx> Date: Sat, 3 Jan 2009 07:58:44 -0800 Subject: [PATCH] pci: AER driver cleanup: move driver structure to not need prototypes This patch moves the aerdriver structer towards the end of the file, after all the methods have been implemented. This allows the removal of the forward declarations of local static functions to conform better with the kernel prefered coding style. Signed-off-by: Arjan van de Ven <arjan@xxxxxxxxxxxxxxx> --- drivers/pci/pcie/aer/aerdrv.c | 92 +++++++++++++++++++++------------------- 1 files changed, 48 insertions(+), 44 deletions(-) diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index 738563a..22bb8b8 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c @@ -38,50 +38,6 @@ MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); -static int __devinit aer_probe (struct pcie_device *dev, - const struct pcie_port_service_id *id ); -static void aer_remove(struct pcie_device *dev); -static int aer_suspend(struct pcie_device *dev, pm_message_t state) -{return 0;} -static int aer_resume(struct pcie_device *dev) {return 0;} -static pci_ers_result_t aer_error_detected(struct pci_dev *dev, - enum pci_channel_state error); -static void aer_error_resume(struct pci_dev *dev); -static pci_ers_result_t aer_root_reset(struct pci_dev *dev); - -/* - * PCI Express bus's AER Root service driver data structure - */ -static struct pcie_port_service_id aer_id[] = { - { - .vendor = PCI_ANY_ID, - .device = PCI_ANY_ID, - .port_type = PCIE_RC_PORT, - .service_type = PCIE_PORT_SERVICE_AER, - }, - { /* end: all zeroes */ } -}; - -static struct pci_error_handlers aer_error_handlers = { - .error_detected = aer_error_detected, - .resume = aer_error_resume, -}; - -static struct pcie_port_service_driver aerdriver = { - .name = "aer", - .id_table = &aer_id[0], - - .probe = aer_probe, - .remove = aer_remove, - - .suspend = aer_suspend, - .resume = aer_resume, - - .err_handler = &aer_error_handlers, - - .reset_link = aer_root_reset, -}; - static int pcie_aer_disable; void pci_no_aer(void) @@ -333,6 +289,54 @@ static void aer_error_resume(struct pci_dev *dev) pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, status); } + +/* + * AER needs no S/R handling nor does it want generic handling + */ +static int aer_suspend(struct pcie_device *dev, pm_message_t state) +{ + return 0; +} + +static int aer_resume(struct pcie_device *dev) +{ + return 0; +} + + +/* + * PCI Express bus's AER Root service driver data structure + */ +static struct pcie_port_service_id aer_id[] = { + { + .vendor = PCI_ANY_ID, + .device = PCI_ANY_ID, + .port_type = PCIE_RC_PORT, + .service_type = PCIE_PORT_SERVICE_AER, + }, + { /* end: all zeroes */ } +}; + +static struct pci_error_handlers aer_error_handlers = { + .error_detected = aer_error_detected, + .resume = aer_error_resume, +}; + +static struct pcie_port_service_driver aerdriver = { + .name = "aer", + .id_table = &aer_id[0], + + .probe = aer_probe, + .remove = aer_remove, + + .suspend = aer_suspend, + .resume = aer_resume, + + .err_handler = &aer_error_handlers, + + .reset_link = aer_root_reset, +}; + /** * aer_service_init - register AER root service driver * -- 1.6.0.6 -- Arjan van de Ven Intel Open Source Technology Centre For development, discussion and tips for power savings, visit http://www.lesswatts.org -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html