[PATCH 1/1] drivers/char/mem.c

Subsystems: char and misc drivers, linux for powerpc (32-bit and 64-bit), the rest

STALE5067d

2 messages, 2 authors, 2012-09-23 · open the first message on its own page

[PATCH 1/1] drivers/char/mem.c

From: Teodori Serge <hidden>
Date: 2012-09-22 21:21:04

replace 'arch_has_dev_port()' to 'CONFIG_DEVPORT'

modified:   arch/powerpc/include/asm/io.h
modified:   drivers/char/mem.c
modified:   include/linux/io.h

why do we need 'arch_has_dev_port()' if we have a 'CONFIG_DEVPORT'?

Signed-off-by: Teodori Serge <redacted>
---
 arch/powerpc/include/asm/io.h |    2 +-
 drivers/char/mem.c            |    6 ------
 include/linux/io.h            |    9 ---------
 3 files changed, 1 insertion(+), 16 deletions(-)
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index f94ef42..cb8b663 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -25,7 +25,7 @@ extern struct pci_dev *isa_bridge_pcidev;
 /*
  * has legacy ISA devices ?
  */
-#define arch_has_dev_port()	(isa_bridge_pcidev != NULL)
+#define CONFIG_DEVPORT	(isa_bridge_pcidev != NULL)
 #endif
 
 #include <linux/device.h>
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index e5eedfa..7251a67 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -897,12 +897,6 @@ static int __init chr_dev_init(void)
 		if (!devlist[minor].name)
 			continue;
 
-		/*
-		 * Create /dev/port? 
-		 */
-		if ((minor == DEVPORT_MINOR) && !arch_has_dev_port())
-			continue;
-
 		device_create(mem_class, NULL, MKDEV(MEM_MAJOR, minor),
 			      NULL, devlist[minor].name);
 	}
diff --git a/include/linux/io.h b/include/linux/io.h
index 069e407..7fd2d21 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -67,13 +67,4 @@ int check_signature(const volatile void __iomem *io_addr,
 			const unsigned char *signature, int length);
 void devm_ioremap_release(struct device *dev, void *res);
 
-/*
- * Some systems do not have legacy ISA devices.
- * /dev/port is not a valid interface on these systems.
- * So for those archs, <asm/io.h> should define the following symbol.
- */
-#ifndef arch_has_dev_port
-#define arch_has_dev_port()     (1)
-#endif
-
 #endif /* _LINUX_IO_H */
-- 
1.7.9.5

Re: [PATCH 1/1] drivers/char/mem.c

From: Arnd Bergmann <arnd@arndb.de>
Date: 2012-09-23 14:17:00

On Saturday 22 September 2012, Teodori Serge wrote:
quoted hunk
replace 'arch_has_dev_port()' to 'CONFIG_DEVPORT'

modified:   arch/powerpc/include/asm/io.h
modified:   drivers/char/mem.c
modified:   include/linux/io.h

why do we need 'arch_has_dev_port()' if we have a 'CONFIG_DEVPORT'?

Signed-off-by: Teodori Serge <redacted>
---
 arch/powerpc/include/asm/io.h |    2 +-
 drivers/char/mem.c            |    6 ------
 include/linux/io.h            |    9 ---------
 3 files changed, 1 insertion(+), 16 deletions(-)
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index f94ef42..cb8b663 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -25,7 +25,7 @@ extern struct pci_dev *isa_bridge_pcidev;
 /*
  * has legacy ISA devices ?
  */
-#define arch_has_dev_port()	(isa_bridge_pcidev != NULL)
+#define CONFIG_DEVPORT	(isa_bridge_pcidev != NULL)
 #endif
 
 #include <linux/device.h>
By convention, CONFIG_* symbols should only be set by Kconfig and not used
for runtime checks.

Also, the existing checks for those symbols check for whether it is
defined, not for the actual value. With what you have there,
the driver will always enable /dev/ports because CONFIG_DEVPORT
is defined.

What are you actually trying to achieve?

	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help