diff options
author | Adrian Bunk <bunk@kernel.org> | 2007-12-11 17:19:41 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-01 18:04:25 -0500 |
commit | 6a9e7f203187e22e96588fa0156b2652841196bf (patch) | |
tree | 2120eb0ffca8e425fec61b99a85dfd2c76c764e3 /drivers | |
parent | 6bae1d96c6d7dde078994f6cb98235fd46f8736b (diff) |
PCI: drivers/pci/msi.c: move arch hooks to the top
This patch fixes the following problem present with older gcc versions:
<-- snip -->
...
CC drivers/pci/msi.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:692: warning: weak declaration of `arch_msi_check_device' after first use results in unspecified behavior
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:704: warning: weak declaration of `arch_setup_msi_irqs' after first use results in unspecified behavior
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/pci/msi.c:724: warning: weak declaration of `arch_teardown_msi_irqs' after first use results in unspecified behavior
...
<-- snip -->
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/msi.c | 91 |
1 files changed, 45 insertions, 46 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 30de51fcd68c..26938da8f438 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -25,6 +25,51 @@ | |||
25 | 25 | ||
26 | static int pci_msi_enable = 1; | 26 | static int pci_msi_enable = 1; |
27 | 27 | ||
28 | /* Arch hooks */ | ||
29 | |||
30 | int __attribute__ ((weak)) | ||
31 | arch_msi_check_device(struct pci_dev *dev, int nvec, int type) | ||
32 | { | ||
33 | return 0; | ||
34 | } | ||
35 | |||
36 | int __attribute__ ((weak)) | ||
37 | arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *entry) | ||
38 | { | ||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | int __attribute__ ((weak)) | ||
43 | arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | ||
44 | { | ||
45 | struct msi_desc *entry; | ||
46 | int ret; | ||
47 | |||
48 | list_for_each_entry(entry, &dev->msi_list, list) { | ||
49 | ret = arch_setup_msi_irq(dev, entry); | ||
50 | if (ret) | ||
51 | return ret; | ||
52 | } | ||
53 | |||
54 | return 0; | ||
55 | } | ||
56 | |||
57 | void __attribute__ ((weak)) arch_teardown_msi_irq(unsigned int irq) | ||
58 | { | ||
59 | return; | ||
60 | } | ||
61 | |||
62 | void __attribute__ ((weak)) | ||
63 | arch_teardown_msi_irqs(struct pci_dev *dev) | ||
64 | { | ||
65 | struct msi_desc *entry; | ||
66 | |||
67 | list_for_each_entry(entry, &dev->msi_list, list) { | ||
68 | if (entry->irq != 0) | ||
69 | arch_teardown_msi_irq(entry->irq); | ||
70 | } | ||
71 | } | ||
72 | |||
28 | static void msi_set_enable(struct pci_dev *dev, int enable) | 73 | static void msi_set_enable(struct pci_dev *dev, int enable) |
29 | { | 74 | { |
30 | int pos; | 75 | int pos; |
@@ -682,49 +727,3 @@ void pci_msi_init_pci_dev(struct pci_dev *dev) | |||
682 | { | 727 | { |
683 | INIT_LIST_HEAD(&dev->msi_list); | 728 | INIT_LIST_HEAD(&dev->msi_list); |
684 | } | 729 | } |
685 | |||
686 | |||
687 | /* Arch hooks */ | ||
688 | |||
689 | int __attribute__ ((weak)) | ||
690 | arch_msi_check_device(struct pci_dev* dev, int nvec, int type) | ||
691 | { | ||
692 | return 0; | ||
693 | } | ||
694 | |||
695 | int __attribute__ ((weak)) | ||
696 | arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *entry) | ||
697 | { | ||
698 | return 0; | ||
699 | } | ||
700 | |||
701 | int __attribute__ ((weak)) | ||
702 | arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | ||
703 | { | ||
704 | struct msi_desc *entry; | ||
705 | int ret; | ||
706 | |||
707 | list_for_each_entry(entry, &dev->msi_list, list) { | ||
708 | ret = arch_setup_msi_irq(dev, entry); | ||
709 | if (ret) | ||
710 | return ret; | ||
711 | } | ||
712 | |||
713 | return 0; | ||
714 | } | ||
715 | |||
716 | void __attribute__ ((weak)) arch_teardown_msi_irq(unsigned int irq) | ||
717 | { | ||
718 | return; | ||
719 | } | ||
720 | |||
721 | void __attribute__ ((weak)) | ||
722 | arch_teardown_msi_irqs(struct pci_dev *dev) | ||
723 | { | ||
724 | struct msi_desc *entry; | ||
725 | |||
726 | list_for_each_entry(entry, &dev->msi_list, list) { | ||
727 | if (entry->irq != 0) | ||
728 | arch_teardown_msi_irq(entry->irq); | ||
729 | } | ||
730 | } | ||