Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313689
b: refs/heads/master
c: e1612de
h: refs/heads/master
i:
  313687: 21d3815
v: v3
  • Loading branch information
Haren Myneni authored and Benjamin Herrenschmidt committed Jul 11, 2012
1 parent 6513c99 commit a93592e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 475d0094293b51353e342d1198377967dbc48169
refs/heads/master: e1612de9e4cdf375c3cf1c72434ab8abdcb3927e
8 changes: 8 additions & 0 deletions trunk/arch/powerpc/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ extern int check_legacy_ioport(unsigned long base_port);
#define _PNPWRP 0xa79
#define PNPBIOS_BASE 0xf000

#if defined(CONFIG_PPC64) && defined(CONFIG_PCI)
extern struct pci_dev *isa_bridge_pcidev;
/*
* has legacy ISA devices ?
*/
#define arch_has_dev_port() (isa_bridge_pcidev != NULL)
#endif

#include <linux/device.h>
#include <linux/io.h>

Expand Down
11 changes: 10 additions & 1 deletion trunk/drivers/char/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@
#include <linux/splice.h>
#include <linux/pfn.h>
#include <linux/export.h>
#include <linux/io.h>

#include <asm/uaccess.h>
#include <asm/io.h>

#ifdef CONFIG_IA64
# include <linux/efi.h>
#endif

#define DEVPORT_MINOR 4

static inline unsigned long size_inside_page(unsigned long start,
unsigned long size)
{
Expand Down Expand Up @@ -894,6 +896,13 @@ static int __init chr_dev_init(void)
for (minor = 1; minor < ARRAY_SIZE(devlist); minor++) {
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);
}
Expand Down
9 changes: 9 additions & 0 deletions trunk/include/linux/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,13 @@ 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 */

0 comments on commit a93592e

Please sign in to comment.