diff options
author | Daniel Axtens <dja@axtens.net> | 2015-03-31 01:00:41 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-04-11 06:49:10 -0400 |
commit | c88c2a188905cb3077c3c38dc498e7e9f8eebeee (patch) | |
tree | 36fd0a09d7edba5db25562836d3228c6a823fd5f | |
parent | ba9c8f227358bcbc80fca19e7a339883cbc956a5 (diff) |
powerpc: pcibios_enable_device_hook: return bool rather than int
pcibios_enable_device_hook returned an int. Every implementation
returned either -EINVAL or 0. The return value wasn't propagated by
the caller: any non-zero return value caused pcibios_enable_device
to return -EINVAL itself. Therefore, make the hook return a bool.
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/include/asm/machdep.h | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pci.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pmac.h | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/pci-ioda.c | 8 |
5 files changed, 12 insertions, 12 deletions
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 098d51e924ea..e29f058c0903 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h | |||
@@ -237,9 +237,9 @@ struct machdep_calls { | |||
237 | /* Called for each PCI bus in the system when it's probed */ | 237 | /* Called for each PCI bus in the system when it's probed */ |
238 | void (*pcibios_fixup_bus)(struct pci_bus *); | 238 | void (*pcibios_fixup_bus)(struct pci_bus *); |
239 | 239 | ||
240 | /* Called when pci_enable_device() is called. Returns 0 to | 240 | /* Called when pci_enable_device() is called. Returns true to |
241 | * allow assignment/enabling of the device. */ | 241 | * allow assignment/enabling of the device. */ |
242 | int (*pcibios_enable_device_hook)(struct pci_dev *); | 242 | bool (*pcibios_enable_device_hook)(struct pci_dev *); |
243 | 243 | ||
244 | /* Called after scan and before resource survey */ | 244 | /* Called after scan and before resource survey */ |
245 | void (*pcibios_fixup_phb)(struct pci_controller *hose); | 245 | void (*pcibios_fixup_phb)(struct pci_controller *hose); |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index bcf618bfff1e..17827c7345a7 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -1451,7 +1451,7 @@ EXPORT_SYMBOL_GPL(pcibios_finish_adding_to_bus); | |||
1451 | int pcibios_enable_device(struct pci_dev *dev, int mask) | 1451 | int pcibios_enable_device(struct pci_dev *dev, int mask) |
1452 | { | 1452 | { |
1453 | if (ppc_md.pcibios_enable_device_hook) | 1453 | if (ppc_md.pcibios_enable_device_hook) |
1454 | if (ppc_md.pcibios_enable_device_hook(dev)) | 1454 | if (!ppc_md.pcibios_enable_device_hook(dev)) |
1455 | return -EINVAL; | 1455 | return -EINVAL; |
1456 | 1456 | ||
1457 | return pci_enable_resources(dev, mask); | 1457 | return pci_enable_resources(dev, mask); |
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c index a792f4552442..9c89fd29da60 100644 --- a/arch/powerpc/platforms/powermac/pci.c +++ b/arch/powerpc/platforms/powermac/pci.c | |||
@@ -942,7 +942,7 @@ void __init pmac_pci_init(void) | |||
942 | } | 942 | } |
943 | 943 | ||
944 | #ifdef CONFIG_PPC32 | 944 | #ifdef CONFIG_PPC32 |
945 | int pmac_pci_enable_device_hook(struct pci_dev *dev) | 945 | bool pmac_pci_enable_device_hook(struct pci_dev *dev) |
946 | { | 946 | { |
947 | struct device_node* node; | 947 | struct device_node* node; |
948 | int updatecfg = 0; | 948 | int updatecfg = 0; |
@@ -958,11 +958,11 @@ int pmac_pci_enable_device_hook(struct pci_dev *dev) | |||
958 | && !node) { | 958 | && !node) { |
959 | printk(KERN_INFO "Apple USB OHCI %s disabled by firmware\n", | 959 | printk(KERN_INFO "Apple USB OHCI %s disabled by firmware\n", |
960 | pci_name(dev)); | 960 | pci_name(dev)); |
961 | return -EINVAL; | 961 | return false; |
962 | } | 962 | } |
963 | 963 | ||
964 | if (!node) | 964 | if (!node) |
965 | return 0; | 965 | return true; |
966 | 966 | ||
967 | uninorth_child = node->parent && | 967 | uninorth_child = node->parent && |
968 | of_device_is_compatible(node->parent, "uni-north"); | 968 | of_device_is_compatible(node->parent, "uni-north"); |
@@ -1003,7 +1003,7 @@ int pmac_pci_enable_device_hook(struct pci_dev *dev) | |||
1003 | L1_CACHE_BYTES >> 2); | 1003 | L1_CACHE_BYTES >> 2); |
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | return 0; | 1006 | return true; |
1007 | } | 1007 | } |
1008 | 1008 | ||
1009 | void pmac_pci_fixup_ohci(struct pci_dev *dev) | 1009 | void pmac_pci_fixup_ohci(struct pci_dev *dev) |
diff --git a/arch/powerpc/platforms/powermac/pmac.h b/arch/powerpc/platforms/powermac/pmac.h index 46d219345537..b8d572159faa 100644 --- a/arch/powerpc/platforms/powermac/pmac.h +++ b/arch/powerpc/platforms/powermac/pmac.h | |||
@@ -25,7 +25,7 @@ extern void pmac_pci_init(void); | |||
25 | extern void pmac_nvram_update(void); | 25 | extern void pmac_nvram_update(void); |
26 | extern unsigned char pmac_nvram_read_byte(int addr); | 26 | extern unsigned char pmac_nvram_read_byte(int addr); |
27 | extern void pmac_nvram_write_byte(int addr, unsigned char val); | 27 | extern void pmac_nvram_write_byte(int addr, unsigned char val); |
28 | extern int pmac_pci_enable_device_hook(struct pci_dev *dev); | 28 | extern bool pmac_pci_enable_device_hook(struct pci_dev *dev); |
29 | extern void pmac_pcibios_after_init(void); | 29 | extern void pmac_pcibios_after_init(void); |
30 | extern int of_show_percpuinfo(struct seq_file *m, int i); | 30 | extern int of_show_percpuinfo(struct seq_file *m, int i); |
31 | 31 | ||
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 76b344125cef..f93d6c2bd743 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -1911,7 +1911,7 @@ static resource_size_t pnv_pci_window_alignment(struct pci_bus *bus, | |||
1911 | /* Prevent enabling devices for which we couldn't properly | 1911 | /* Prevent enabling devices for which we couldn't properly |
1912 | * assign a PE | 1912 | * assign a PE |
1913 | */ | 1913 | */ |
1914 | static int pnv_pci_enable_device_hook(struct pci_dev *dev) | 1914 | static bool pnv_pci_enable_device_hook(struct pci_dev *dev) |
1915 | { | 1915 | { |
1916 | struct pci_controller *hose = pci_bus_to_host(dev->bus); | 1916 | struct pci_controller *hose = pci_bus_to_host(dev->bus); |
1917 | struct pnv_phb *phb = hose->private_data; | 1917 | struct pnv_phb *phb = hose->private_data; |
@@ -1923,13 +1923,13 @@ static int pnv_pci_enable_device_hook(struct pci_dev *dev) | |||
1923 | * PEs isn't ready. | 1923 | * PEs isn't ready. |
1924 | */ | 1924 | */ |
1925 | if (!phb->initialized) | 1925 | if (!phb->initialized) |
1926 | return 0; | 1926 | return true; |
1927 | 1927 | ||
1928 | pdn = pci_get_pdn(dev); | 1928 | pdn = pci_get_pdn(dev); |
1929 | if (!pdn || pdn->pe_number == IODA_INVALID_PE) | 1929 | if (!pdn || pdn->pe_number == IODA_INVALID_PE) |
1930 | return -EINVAL; | 1930 | return false; |
1931 | 1931 | ||
1932 | return 0; | 1932 | return true; |
1933 | } | 1933 | } |
1934 | 1934 | ||
1935 | static u32 pnv_ioda_bdfn_to_pe(struct pnv_phb *phb, struct pci_bus *bus, | 1935 | static u32 pnv_ioda_bdfn_to_pe(struct pnv_phb *phb, struct pci_bus *bus, |