# \[PATCH\] Use check\_legacy\_ioport() for ISAPnP

- From: David Woodhouse \<dwmw2@infradead.org\>
- Date: 2006-09-27 07:19:05 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2006/09/9409889
- Thread: https://ratatoskr.run/linuxppc-dev/2006/09/9409889/t.md

```text
Signed-off-by: David Woodhouse <dwmw2@infradead.org>

diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index f2e0179..3ac5b12 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -1049,6 +1049,10 @@ static int __init isapnp_init(void)
 		printk(KERN_INFO "isapnp: ISA Plug & Play support disabled\n");
 		return 0;
 	}
+#ifdef CONFIG_PPC_MERGE
+	if (check_legacy_ioport(_PIDXR) || check_legacy_ioport(_PNPWRP))
+		return -EINVAL;
+#endif
 #ifdef ISAPNP_REGION_OK
 	if (!request_region(_PIDXR, 1, "isapnp index")) {
 		printk(KERN_ERR "isapnp: Index Register 0x%x already used\n", _PIDXR);

-- 
dwmw2
```
