Skip to content

Commit

Permalink
powerpc: Refactor board check for PCI quirks on FSL boards with uli1575
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kumar Gala committed May 19, 2009
1 parent 28eac2b commit 9bf8b27
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions arch/powerpc/platforms/fsl_uli1575.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,19 @@ u8 uli_pirq_to_irq[8] = {
ULI_8259_NONE, /* PIRQH */
};

static inline bool is_quirk_valid(void)
{
return (machine_is(mpc86xx_hpcn) ||
machine_is(mpc8544_ds) ||
machine_is(mpc8572_ds));
}

/* Bridge */
static void __devinit early_uli5249(struct pci_dev *dev)
{
unsigned char temp;

if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) &&
!machine_is(mpc8572_ds))
if (!is_quirk_valid())
return;

pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_IO |
Expand All @@ -80,8 +86,7 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)
{
int i;

if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) &&
!machine_is(mpc8572_ds))
if (!is_quirk_valid())
return;

/*
Expand Down Expand Up @@ -149,8 +154,7 @@ static void __devinit quirk_final_uli1575(struct pci_dev *dev)
* IRQ 14: Edge
* IRQ 15: Edge
*/
if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) &&
!machine_is(mpc8572_ds))
if (!is_quirk_valid())
return;

outb(0xfa, 0x4d0);
Expand All @@ -176,8 +180,7 @@ static void __devinit quirk_uli5288(struct pci_dev *dev)
unsigned char c;
unsigned int d;

if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) &&
!machine_is(mpc8572_ds))
if (!is_quirk_valid())
return;

/* read/write lock */
Expand All @@ -201,8 +204,7 @@ static void __devinit quirk_uli5229(struct pci_dev *dev)
{
unsigned short temp;

if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) &&
!machine_is(mpc8572_ds))
if (!is_quirk_valid())
return;

pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE |
Expand Down Expand Up @@ -270,7 +272,6 @@ static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev)
static void __devinit hpcd_quirk_uli5288(struct pci_dev *dev)
{
unsigned char c;
unsigned short temp;

if (!machine_is(mpc86xx_hpcd))
return;
Expand Down

0 comments on commit 9bf8b27

Please sign in to comment.