diff options
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r-- | drivers/char/mem.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 947cb3cef816..e3085b22a365 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -484,7 +484,7 @@ static ssize_t write_kmem(struct file * file, const char __user * buf, | |||
484 | return virtr + wrote; | 484 | return virtr + wrote; |
485 | } | 485 | } |
486 | 486 | ||
487 | #if defined(CONFIG_ISA) || !defined(__mc68000__) | 487 | #if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI)) |
488 | static ssize_t read_port(struct file * file, char __user * buf, | 488 | static ssize_t read_port(struct file * file, char __user * buf, |
489 | size_t count, loff_t *ppos) | 489 | size_t count, loff_t *ppos) |
490 | { | 490 | { |
@@ -744,7 +744,7 @@ static struct file_operations null_fops = { | |||
744 | .write = write_null, | 744 | .write = write_null, |
745 | }; | 745 | }; |
746 | 746 | ||
747 | #if defined(CONFIG_ISA) || !defined(__mc68000__) | 747 | #if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI)) |
748 | static struct file_operations port_fops = { | 748 | static struct file_operations port_fops = { |
749 | .llseek = memory_lseek, | 749 | .llseek = memory_lseek, |
750 | .read = read_port, | 750 | .read = read_port, |
@@ -804,7 +804,7 @@ static int memory_open(struct inode * inode, struct file * filp) | |||
804 | case 3: | 804 | case 3: |
805 | filp->f_op = &null_fops; | 805 | filp->f_op = &null_fops; |
806 | break; | 806 | break; |
807 | #if defined(CONFIG_ISA) || !defined(__mc68000__) | 807 | #if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI)) |
808 | case 4: | 808 | case 4: |
809 | filp->f_op = &port_fops; | 809 | filp->f_op = &port_fops; |
810 | break; | 810 | break; |
@@ -846,7 +846,7 @@ static const struct { | |||
846 | {1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops}, | 846 | {1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops}, |
847 | {2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops}, | 847 | {2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops}, |
848 | {3, "null", S_IRUGO | S_IWUGO, &null_fops}, | 848 | {3, "null", S_IRUGO | S_IWUGO, &null_fops}, |
849 | #if defined(CONFIG_ISA) || !defined(__mc68000__) | 849 | #if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI)) |
850 | {4, "port", S_IRUSR | S_IWUSR | S_IRGRP, &port_fops}, | 850 | {4, "port", S_IRUSR | S_IWUSR | S_IRGRP, &port_fops}, |
851 | #endif | 851 | #endif |
852 | {5, "zero", S_IRUGO | S_IWUGO, &zero_fops}, | 852 | {5, "zero", S_IRUGO | S_IWUGO, &zero_fops}, |
@@ -856,7 +856,7 @@ static const struct { | |||
856 | {11,"kmsg", S_IRUGO | S_IWUSR, &kmsg_fops}, | 856 | {11,"kmsg", S_IRUGO | S_IWUSR, &kmsg_fops}, |
857 | }; | 857 | }; |
858 | 858 | ||
859 | static struct class_simple *mem_class; | 859 | static struct class *mem_class; |
860 | 860 | ||
861 | static int __init chr_dev_init(void) | 861 | static int __init chr_dev_init(void) |
862 | { | 862 | { |
@@ -865,10 +865,9 @@ static int __init chr_dev_init(void) | |||
865 | if (register_chrdev(MEM_MAJOR,"mem",&memory_fops)) | 865 | if (register_chrdev(MEM_MAJOR,"mem",&memory_fops)) |
866 | printk("unable to get major %d for memory devs\n", MEM_MAJOR); | 866 | printk("unable to get major %d for memory devs\n", MEM_MAJOR); |
867 | 867 | ||
868 | mem_class = class_simple_create(THIS_MODULE, "mem"); | 868 | mem_class = class_create(THIS_MODULE, "mem"); |
869 | for (i = 0; i < ARRAY_SIZE(devlist); i++) { | 869 | for (i = 0; i < ARRAY_SIZE(devlist); i++) { |
870 | class_simple_device_add(mem_class, | 870 | class_device_create(mem_class, MKDEV(MEM_MAJOR, devlist[i].minor), |
871 | MKDEV(MEM_MAJOR, devlist[i].minor), | ||
872 | NULL, devlist[i].name); | 871 | NULL, devlist[i].name); |
873 | devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor), | 872 | devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor), |
874 | S_IFCHR | devlist[i].mode, devlist[i].name); | 873 | S_IFCHR | devlist[i].mode, devlist[i].name); |