* [PATCH] mips/ip32: enable PCI bridges
@ 2007-10-04 21:09 Giuseppe Sacco
2007-10-05 12:21 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: Giuseppe Sacco @ 2007-10-04 21:09 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips
Fixes MACE PCI addressing 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 <eppesuig@debian.org>
---
Hi Ralf and linux-mips list,
I managed to create a second patch, still against current
.6.23-rc9 git tree, for supporting PCI bridges on SGI ip32 machines.
It include your suggestion on moving from #define to inline.
Bye,
Giuseppe
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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mips/ip32: enable PCI bridges
2007-10-04 21:09 [PATCH] mips/ip32: enable PCI bridges Giuseppe Sacco
@ 2007-10-05 12:21 ` Ralf Baechle
0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2007-10-05 12:21 UTC (permalink / raw)
To: Giuseppe Sacco; +Cc: linux-mips
On Thu, Oct 04, 2007 at 11:09:12PM +0200, Giuseppe Sacco wrote:
> Fixes MACE PCI addressing 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 <eppesuig@debian.org>
Thanks, applied.
Ralf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-10-05 12:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-04 21:09 [PATCH] mips/ip32: enable PCI bridges Giuseppe Sacco
2007-10-05 12:21 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox