Skip to contentSkip to conversation

m68k: Add missing ioport_unmap()

PATCH In review Geert Uytterhoeven 2 participants 5 messages Sep 14, 2014 – Sep 16, 2014 2 messages not in the archive m68k architecture

lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

PATCH 1/1 m68k: Add missing ioport_unmap()

drivers/net/ethernet/cirrus/cs89x0.c: In function ‘cs89x0_ioport_probe’:
drivers/net/ethernet/cirrus/cs89x0.c:1629: error: implicit declaration of function ‘ioport_unmap’

Add the missing ioport_unmap() implementation, and convert ioport_map() from a macro to a static inline function while we're at it (both copied from asm-generic).

---
 arch/m68k/include/asm/io_mm.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
arch/m68k/include/asm/io_mm.h +8 -1
index ffdf54f44bc6..8955b40a5dc4 100644
@@ -510,6 +510,13 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int
  */
 #define xlate_dev_kmem_ptr(p)	p
 
-#define ioport_map(port, nr)	((void __iomem *)(port))
+static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
+{
+	return (void __iomem *) port;
+}
+
+static inline void ioport_unmap(void __iomem *p)
+{
+}
 
 #endif /* _IO_H */
Signature · 1 line
1.9.1
#1 lore raw

Hi Geert,

Quoted 6 lines · Geert Uytterhoeven

drivers/net/ethernet/cirrus/cs89x0.c: In function ‘cs89x0_ioport_probe’:
drivers/net/ethernet/cirrus/cs89x0.c:1629: error: implicit declaration of function ‘ioport_unmap’

Add the missing ioport_unmap() implementation, and convert ioport_map() from a macro to a static inline function while we're at it (both copied from asm-generic).

The non-mmu version of this, io_no.h, doesn't implement these either. Should it?

Regards
Greg

Quoted 25 lines
---
 arch/m68k/include/asm/io_mm.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
arch/m68k/include/asm/io_mm.h +8 -1
index ffdf54f44bc6..8955b40a5dc4 100644
@@ -510,6 +510,13 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int
  */
 #define xlate_dev_kmem_ptr(p)	p
 
-#define ioport_map(port, nr)	((void __iomem *)(port))
+static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
+{
+	return (void __iomem *) port;
+}
+
+static inline void ioport_unmap(void __iomem *p)
+{
+}
 
 #endif /* _IO_H */

A message that is not in the archive (sent off-list or not yet received): [email protected]

author maintainer
#3 lore raw

Hi Greg,

Quoted 10 lines · Greg Ungerer
Quoted 6 lines · Geert Uytterhoeven

drivers/net/ethernet/cirrus/cs89x0.c: In function ‘cs89x0_ioport_probe’:
drivers/net/ethernet/cirrus/cs89x0.c:1629: error: implicit declaration of function ‘ioport_unmap’

Add the missing ioport_unmap() implementation, and convert ioport_map() from a macro to a static inline function while we're at it (both copied from asm-generic).

The non-mmu version of this, io_no.h, doesn't implement these either. Should it?

I think it should. However, you probably can't get there without PCI or ISA enabled.

(doing some experiments with M548x/allmodconfig builds)

Currently PCI on M54xx is limited to MMU=y?
As soon as PCI can be enabled with MMU=n, you can get to:

lib/pci_iomap.c: In function ‘pci_iomap’:
lib/pci_iomap.c:37: error: implicit declaration of function ‘ioport_map’ lib/pci_iomap.c:37: warning: return makes pointer from integer without a cast

drivers/gpio/gpio-amd8111.c: In function ‘amd_gpio_init’:
drivers/gpio/gpio-amd8111.c:215: error: implicit declaration of function ‘ioport_map’
drivers/gpio/gpio-amd8111.c:215: warning: assignment makes pointer from integer without a cast drivers/gpio/gpio-amd8111.c: In function ‘amd_gpio_exit’:
drivers/gpio/gpio-amd8111.c:236: error: implicit declaration of function ‘ioport_unmap’

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#4 lore raw

Hi Geert,

Quoted 12 lines · Geert Uytterhoeven
Quoted 10 lines · Greg Ungerer
Quoted 6 lines · Geert Uytterhoeven

drivers/net/ethernet/cirrus/cs89x0.c: In function ‘cs89x0_ioport_probe’:
drivers/net/ethernet/cirrus/cs89x0.c:1629: error: implicit declaration of function ‘ioport_unmap’

Add the missing ioport_unmap() implementation, and convert ioport_map() from a macro to a static inline function while we're at it (both copied from asm-generic).

The non-mmu version of this, io_no.h, doesn't implement these either. Should it?

Quoted 6 lines

I think it should. However, you probably can't get there without PCI or ISA enabled.

(doing some experiments with M548x/allmodconfig builds)

Currently PCI on M54xx is limited to MMU=y?

Yes, though I am not sure why we have it limited to that case.

Quoted 6 lines

As soon as PCI can be enabled with MMU=n, you can get to:

lib/pci_iomap.c: In function ‘pci_iomap’:
lib/pci_iomap.c:37: error: implicit declaration of function ‘ioport_map’ lib/pci_iomap.c:37: warning: return makes pointer from integer without a cast

Quoted 8 lines

drivers/gpio/gpio-amd8111.c: In function ‘amd_gpio_init’:
drivers/gpio/gpio-amd8111.c:215: error: implicit declaration of function ‘ioport_map’
drivers/gpio/gpio-amd8111.c:215: warning: assignment makes pointer from integer without a cast drivers/gpio/gpio-amd8111.c: In function ‘amd_gpio_exit’:
drivers/gpio/gpio-amd8111.c:236: error: implicit declaration of function ‘ioport_unmap’

Ok, I say yes we need it for non-MMU too. Do you want to come up with another patch for the non-MMU case, or do you want me to do it?

Regards
Greg

A message that is not in the archive (sent off-list or not yet received): [email protected]

author maintainer
#6 lore raw

Hi Greg,

Quoted 13 lines · Greg Ungerer
Quoted 12 lines · Geert Uytterhoeven
Quoted 10 lines · Greg Ungerer
Quoted 6 lines · Geert Uytterhoeven

drivers/net/ethernet/cirrus/cs89x0.c: In function ‘cs89x0_ioport_probe’:
drivers/net/ethernet/cirrus/cs89x0.c:1629: error: implicit declaration of function ‘ioport_unmap’

Add the missing ioport_unmap() implementation, and convert ioport_map() from a macro to a static inline function while we're at it (both copied from asm-generic).

The non-mmu version of this, io_no.h, doesn't implement these either. Should it?

Quoted 8 lines
Quoted 6 lines

I think it should. However, you probably can't get there without PCI or ISA enabled.

(doing some experiments with M548x/allmodconfig builds)

Currently PCI on M54xx is limited to MMU=y?

Yes, though I am not sure why we have it limited to that case.

Yeah, I was wondering the same...

Quoted 15 lines
Quoted 6 lines

As soon as PCI can be enabled with MMU=n, you can get to:

lib/pci_iomap.c: In function ‘pci_iomap’:
lib/pci_iomap.c:37: error: implicit declaration of function ‘ioport_map’ lib/pci_iomap.c:37: warning: return makes pointer from integer without a cast

Quoted 8 lines

drivers/gpio/gpio-amd8111.c: In function ‘amd_gpio_init’:
drivers/gpio/gpio-amd8111.c:215: error: implicit declaration of function ‘ioport_map’
drivers/gpio/gpio-amd8111.c:215: warning: assignment makes pointer from integer without a cast drivers/gpio/gpio-amd8111.c: In function ‘amd_gpio_exit’:
drivers/gpio/gpio-amd8111.c:236: error: implicit declaration of function ‘ioport_unmap’

Quoted 2 lines

Ok, I say yes we need it for non-MMU too. Do you want to come up with another patch for the non-MMU case, or do you want me to do it?

Feel free to write a patch when you have time...

Groetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds