Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8cfaf45367d41400ce99e1757ab5690d1fc94dbc
Commit:     8cfaf45367d41400ce99e1757ab5690d1fc94dbc
Parent:     804b3f9a16e446cb023417faec58b6506c834052
Author:     Giuseppe Sacco <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 4 23:09:12 2007 +0200
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Oct 5 13:31:22 2007 +0100

    [MIPS] IP32: Enable PCI bridges
    
    Fixe MACE PCI addressing by adding the bus number parameter.
    Remove check of the used slot since every slot should be valid.
    Converted mkaddr from #define to inline function.
    
    Signed-off-by: Giuseppe Sacco <[EMAIL PROTECTED]>
    Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/pci/ops-mace.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/arch/mips/pci/ops-mace.c b/arch/mips/pci/ops-mace.c
index 8008e31..2025f1f 100644
--- a/arch/mips/pci/ops-mace.c
+++ b/arch/mips/pci/ops-mace.c
@@ -29,22 +29,20 @@
  * 4  N/C
  */
 
-#define chkslot(_bus,_devfn)                                   \
-do {                                                           \
-       if ((_bus)->number > 0 || PCI_SLOT (_devfn) < 1 \
-           || PCI_SLOT (_devfn) > 3)                           \
-               return PCIBIOS_DEVICE_NOT_FOUND;                \
-} while (0)
+static inline int mkaddr(struct pci_bus *bus, unsigned int devfn,
+       unsigned int reg)
+{
+       return ((bus->number & 0xff) << 16) |
+               (devfn & 0xff) << 8) |
+               (reg & 0xfc);
+}
 
-#define mkaddr(_devfn, _reg) \
-((((_devfn) & 0xffUL) << 8) | ((_reg) & 0xfcUL))
 
 static int
 mace_pci_read_config(struct pci_bus *bus, unsigned int devfn,
                     int reg, int size, u32 *val)
 {
-       chkslot(bus, devfn);
-       mace->pci.config_addr = mkaddr(devfn, reg);
+       mace->pci.config_addr = mkaddr(bus, devfn, reg);
        switch (size) {
        case 1:
                *val = mace->pci.config_data.b[(reg & 3) ^ 3];
@@ -66,8 +64,7 @@ static int
 mace_pci_write_config(struct pci_bus *bus, unsigned int devfn,
                      int reg, int size, u32 val)
 {
-       chkslot(bus, devfn);
-       mace->pci.config_addr = mkaddr(devfn, reg);
+       mace->pci.config_addr = mkaddr(bus, devfn, reg);
        switch (size) {
        case 1:
                mace->pci.config_data.b[(reg & 3) ^ 3] = val;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to