aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/fsl_uli1575.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2009-04-15 15:33:38 -0400
committerKumar Gala <galak@kernel.crashing.org>2009-05-19 01:46:15 -0400
commit9bf8b2741e6cd2e5ee98bfc050e3694890fdc811 (patch)
treee746b3d992adb54076b5e313d29a9d7916eeab67 /arch/powerpc/platforms/fsl_uli1575.c
parent28eac2b74cc7136dee3f2615167811d24d25bc97 (diff)
powerpc: Refactor board check for PCI quirks on FSL boards with uli1575
Refactor the check to determine if the quirk is applicable to the boards into one inline function so we only have to change one place to add more boards that the quirks might be applicable to. Also removed a warning related to unused temp variable. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/fsl_uli1575.c')
-rw-r--r--arch/powerpc/platforms/fsl_uli1575.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c
index 65a35f38e062..efd41f40984f 100644
--- a/arch/powerpc/platforms/fsl_uli1575.c
+++ b/arch/powerpc/platforms/fsl_uli1575.c
@@ -51,13 +51,19 @@ u8 uli_pirq_to_irq[8] = {
51 ULI_8259_NONE, /* PIRQH */ 51 ULI_8259_NONE, /* PIRQH */
52}; 52};
53 53
54static inline bool is_quirk_valid(void)
55{
56 return (machine_is(mpc86xx_hpcn) ||
57 machine_is(mpc8544_ds) ||
58 machine_is(mpc8572_ds));
59}
60
54/* Bridge */ 61/* Bridge */
55static void __devinit early_uli5249(struct pci_dev *dev) 62static void __devinit early_uli5249(struct pci_dev *dev)
56{ 63{
57 unsigned char temp; 64 unsigned char temp;
58 65
59 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 66 if (!is_quirk_valid())
60 !machine_is(mpc8572_ds))
61 return; 67 return;
62 68
63 pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_IO | 69 pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_IO |
@@ -80,8 +86,7 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)
80{ 86{
81 int i; 87 int i;
82 88
83 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 89 if (!is_quirk_valid())
84 !machine_is(mpc8572_ds))
85 return; 90 return;
86 91
87 /* 92 /*
@@ -149,8 +154,7 @@ static void __devinit quirk_final_uli1575(struct pci_dev *dev)
149 * IRQ 14: Edge 154 * IRQ 14: Edge
150 * IRQ 15: Edge 155 * IRQ 15: Edge
151 */ 156 */
152 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 157 if (!is_quirk_valid())
153 !machine_is(mpc8572_ds))
154 return; 158 return;
155 159
156 outb(0xfa, 0x4d0); 160 outb(0xfa, 0x4d0);
@@ -176,8 +180,7 @@ static void __devinit quirk_uli5288(struct pci_dev *dev)
176 unsigned char c; 180 unsigned char c;
177 unsigned int d; 181 unsigned int d;
178 182
179 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 183 if (!is_quirk_valid())
180 !machine_is(mpc8572_ds))
181 return; 184 return;
182 185
183 /* read/write lock */ 186 /* read/write lock */
@@ -201,8 +204,7 @@ static void __devinit quirk_uli5229(struct pci_dev *dev)
201{ 204{
202 unsigned short temp; 205 unsigned short temp;
203 206
204 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 207 if (!is_quirk_valid())
205 !machine_is(mpc8572_ds))
206 return; 208 return;
207 209
208 pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE | 210 pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE |
@@ -270,7 +272,6 @@ static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev)
270static void __devinit hpcd_quirk_uli5288(struct pci_dev *dev) 272static void __devinit hpcd_quirk_uli5288(struct pci_dev *dev)
271{ 273{
272 unsigned char c; 274 unsigned char c;
273 unsigned short temp;
274 275
275 if (!machine_is(mpc86xx_hpcd)) 276 if (!machine_is(mpc86xx_hpcd))
276 return; 277 return;