diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/Kconfig | 2 | ||||
-rw-r--r-- | drivers/char/agp/generic.c | 19 | ||||
-rw-r--r-- | drivers/char/bsr.c | 2 | ||||
-rw-r--r-- | drivers/char/hpet.c | 6 | ||||
-rw-r--r-- | drivers/char/hw_random/Kconfig | 2 | ||||
-rw-r--r-- | drivers/char/hw_random/amd-rng.c | 9 | ||||
-rw-r--r-- | drivers/char/hw_random/n2-drv.c | 7 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 7 | ||||
-rw-r--r-- | drivers/char/mem.c | 42 | ||||
-rw-r--r-- | drivers/char/raw.c | 34 | ||||
-rw-r--r-- | drivers/char/virtio_console.c | 11 | ||||
-rw-r--r-- | drivers/char/xilinx_hwicap/xilinx_hwicap.c | 14 |
12 files changed, 101 insertions, 54 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index ad59b4e0a9b5..49502bc5360a 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -523,7 +523,7 @@ config RAW_DRIVER | |||
523 | with the O_DIRECT flag. | 523 | with the O_DIRECT flag. |
524 | 524 | ||
525 | config MAX_RAW_DEVS | 525 | config MAX_RAW_DEVS |
526 | int "Maximum number of RAW devices to support (1-8192)" | 526 | int "Maximum number of RAW devices to support (1-65536)" |
527 | depends on RAW_DRIVER | 527 | depends on RAW_DRIVER |
528 | default "256" | 528 | default "256" |
529 | help | 529 | help |
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index 012cba0d6d96..b072648dc3f6 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c | |||
@@ -115,6 +115,9 @@ static struct agp_memory *agp_create_user_memory(unsigned long num_agp_pages) | |||
115 | struct agp_memory *new; | 115 | struct agp_memory *new; |
116 | unsigned long alloc_size = num_agp_pages*sizeof(struct page *); | 116 | unsigned long alloc_size = num_agp_pages*sizeof(struct page *); |
117 | 117 | ||
118 | if (INT_MAX/sizeof(struct page *) < num_agp_pages) | ||
119 | return NULL; | ||
120 | |||
118 | new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL); | 121 | new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL); |
119 | if (new == NULL) | 122 | if (new == NULL) |
120 | return NULL; | 123 | return NULL; |
@@ -234,11 +237,14 @@ struct agp_memory *agp_allocate_memory(struct agp_bridge_data *bridge, | |||
234 | int scratch_pages; | 237 | int scratch_pages; |
235 | struct agp_memory *new; | 238 | struct agp_memory *new; |
236 | size_t i; | 239 | size_t i; |
240 | int cur_memory; | ||
237 | 241 | ||
238 | if (!bridge) | 242 | if (!bridge) |
239 | return NULL; | 243 | return NULL; |
240 | 244 | ||
241 | if ((atomic_read(&bridge->current_memory_agp) + page_count) > bridge->max_memory_agp) | 245 | cur_memory = atomic_read(&bridge->current_memory_agp); |
246 | if ((cur_memory + page_count > bridge->max_memory_agp) || | ||
247 | (cur_memory + page_count < page_count)) | ||
242 | return NULL; | 248 | return NULL; |
243 | 249 | ||
244 | if (type >= AGP_USER_TYPES) { | 250 | if (type >= AGP_USER_TYPES) { |
@@ -1089,8 +1095,8 @@ int agp_generic_insert_memory(struct agp_memory * mem, off_t pg_start, int type) | |||
1089 | return -EINVAL; | 1095 | return -EINVAL; |
1090 | } | 1096 | } |
1091 | 1097 | ||
1092 | /* AK: could wrap */ | 1098 | if (((pg_start + mem->page_count) > num_entries) || |
1093 | if ((pg_start + mem->page_count) > num_entries) | 1099 | ((pg_start + mem->page_count) < pg_start)) |
1094 | return -EINVAL; | 1100 | return -EINVAL; |
1095 | 1101 | ||
1096 | j = pg_start; | 1102 | j = pg_start; |
@@ -1124,7 +1130,7 @@ int agp_generic_remove_memory(struct agp_memory *mem, off_t pg_start, int type) | |||
1124 | { | 1130 | { |
1125 | size_t i; | 1131 | size_t i; |
1126 | struct agp_bridge_data *bridge; | 1132 | struct agp_bridge_data *bridge; |
1127 | int mask_type; | 1133 | int mask_type, num_entries; |
1128 | 1134 | ||
1129 | bridge = mem->bridge; | 1135 | bridge = mem->bridge; |
1130 | if (!bridge) | 1136 | if (!bridge) |
@@ -1136,6 +1142,11 @@ int agp_generic_remove_memory(struct agp_memory *mem, off_t pg_start, int type) | |||
1136 | if (type != mem->type) | 1142 | if (type != mem->type) |
1137 | return -EINVAL; | 1143 | return -EINVAL; |
1138 | 1144 | ||
1145 | num_entries = agp_num_entries(); | ||
1146 | if (((pg_start + mem->page_count) > num_entries) || | ||
1147 | ((pg_start + mem->page_count) < pg_start)) | ||
1148 | return -EINVAL; | ||
1149 | |||
1139 | mask_type = bridge->driver->agp_type_to_mask_type(bridge, type); | 1150 | mask_type = bridge->driver->agp_type_to_mask_type(bridge, type); |
1140 | if (mask_type != 0) { | 1151 | if (mask_type != 0) { |
1141 | /* The generic routines know nothing of memory types */ | 1152 | /* The generic routines know nothing of memory types */ |
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c index a4a6c2f044b5..cf39bc08ce08 100644 --- a/drivers/char/bsr.c +++ b/drivers/char/bsr.c | |||
@@ -295,7 +295,7 @@ static int bsr_create_devs(struct device_node *bn) | |||
295 | static int __init bsr_init(void) | 295 | static int __init bsr_init(void) |
296 | { | 296 | { |
297 | struct device_node *np; | 297 | struct device_node *np; |
298 | dev_t bsr_dev = MKDEV(bsr_major, 0); | 298 | dev_t bsr_dev; |
299 | int ret = -ENODEV; | 299 | int ret = -ENODEV; |
300 | int result; | 300 | int result; |
301 | 301 | ||
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 7066e801b9d3..051474c65b78 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
@@ -84,8 +84,6 @@ static struct clocksource clocksource_hpet = { | |||
84 | .rating = 250, | 84 | .rating = 250, |
85 | .read = read_hpet, | 85 | .read = read_hpet, |
86 | .mask = CLOCKSOURCE_MASK(64), | 86 | .mask = CLOCKSOURCE_MASK(64), |
87 | .mult = 0, /* to be calculated */ | ||
88 | .shift = 10, | ||
89 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 87 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
90 | }; | 88 | }; |
91 | static struct clocksource *hpet_clocksource; | 89 | static struct clocksource *hpet_clocksource; |
@@ -934,9 +932,7 @@ int hpet_alloc(struct hpet_data *hdp) | |||
934 | if (!hpet_clocksource) { | 932 | if (!hpet_clocksource) { |
935 | hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc; | 933 | hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc; |
936 | CLKSRC_FSYS_MMIO_SET(clocksource_hpet.fsys_mmio, hpet_mctr); | 934 | CLKSRC_FSYS_MMIO_SET(clocksource_hpet.fsys_mmio, hpet_mctr); |
937 | clocksource_hpet.mult = clocksource_hz2mult(hpetp->hp_tick_freq, | 935 | clocksource_register_hz(&clocksource_hpet, hpetp->hp_tick_freq); |
938 | clocksource_hpet.shift); | ||
939 | clocksource_register(&clocksource_hpet); | ||
940 | hpetp->hp_clocksource = &clocksource_hpet; | 936 | hpetp->hp_clocksource = &clocksource_hpet; |
941 | hpet_clocksource = &clocksource_hpet; | 937 | hpet_clocksource = &clocksource_hpet; |
942 | } | 938 | } |
diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig index beecd1cf9b99..a60043b3e409 100644 --- a/drivers/char/hw_random/Kconfig +++ b/drivers/char/hw_random/Kconfig | |||
@@ -49,7 +49,7 @@ config HW_RANDOM_INTEL | |||
49 | 49 | ||
50 | config HW_RANDOM_AMD | 50 | config HW_RANDOM_AMD |
51 | tristate "AMD HW Random Number Generator support" | 51 | tristate "AMD HW Random Number Generator support" |
52 | depends on HW_RANDOM && X86 && PCI | 52 | depends on HW_RANDOM && (X86 || PPC_MAPLE) && PCI |
53 | default HW_RANDOM | 53 | default HW_RANDOM |
54 | ---help--- | 54 | ---help--- |
55 | This driver provides kernel-side support for the Random Number | 55 | This driver provides kernel-side support for the Random Number |
diff --git a/drivers/char/hw_random/amd-rng.c b/drivers/char/hw_random/amd-rng.c index 0d8c5788b8e4..c6af038682f1 100644 --- a/drivers/char/hw_random/amd-rng.c +++ b/drivers/char/hw_random/amd-rng.c | |||
@@ -133,6 +133,12 @@ found: | |||
133 | pmbase &= 0x0000FF00; | 133 | pmbase &= 0x0000FF00; |
134 | if (pmbase == 0) | 134 | if (pmbase == 0) |
135 | goto out; | 135 | goto out; |
136 | if (!request_region(pmbase + 0xF0, 8, "AMD HWRNG")) { | ||
137 | dev_err(&pdev->dev, "AMD HWRNG region 0x%x already in use!\n", | ||
138 | pmbase + 0xF0); | ||
139 | err = -EBUSY; | ||
140 | goto out; | ||
141 | } | ||
136 | amd_rng.priv = (unsigned long)pmbase; | 142 | amd_rng.priv = (unsigned long)pmbase; |
137 | amd_pdev = pdev; | 143 | amd_pdev = pdev; |
138 | 144 | ||
@@ -141,6 +147,7 @@ found: | |||
141 | if (err) { | 147 | if (err) { |
142 | printk(KERN_ERR PFX "RNG registering failed (%d)\n", | 148 | printk(KERN_ERR PFX "RNG registering failed (%d)\n", |
143 | err); | 149 | err); |
150 | release_region(pmbase + 0xF0, 8); | ||
144 | goto out; | 151 | goto out; |
145 | } | 152 | } |
146 | out: | 153 | out: |
@@ -149,6 +156,8 @@ out: | |||
149 | 156 | ||
150 | static void __exit mod_exit(void) | 157 | static void __exit mod_exit(void) |
151 | { | 158 | { |
159 | u32 pmbase = (unsigned long)amd_rng.priv; | ||
160 | release_region(pmbase + 0xF0, 8); | ||
152 | hwrng_unregister(&amd_rng); | 161 | hwrng_unregister(&amd_rng); |
153 | } | 162 | } |
154 | 163 | ||
diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c index 43ac61978d8b..ac6739e085e3 100644 --- a/drivers/char/hw_random/n2-drv.c +++ b/drivers/char/hw_random/n2-drv.c | |||
@@ -619,15 +619,18 @@ static void __devinit n2rng_driver_version(void) | |||
619 | pr_info("%s", version); | 619 | pr_info("%s", version); |
620 | } | 620 | } |
621 | 621 | ||
622 | static const struct of_device_id n2rng_match[]; | ||
622 | static int __devinit n2rng_probe(struct platform_device *op) | 623 | static int __devinit n2rng_probe(struct platform_device *op) |
623 | { | 624 | { |
625 | const struct of_device_id *match; | ||
624 | int victoria_falls; | 626 | int victoria_falls; |
625 | int err = -ENOMEM; | 627 | int err = -ENOMEM; |
626 | struct n2rng *np; | 628 | struct n2rng *np; |
627 | 629 | ||
628 | if (!op->dev.of_match) | 630 | match = of_match_device(n2rng_match, &op->dev); |
631 | if (!match) | ||
629 | return -EINVAL; | 632 | return -EINVAL; |
630 | victoria_falls = (op->dev.of_match->data != NULL); | 633 | victoria_falls = (match->data != NULL); |
631 | 634 | ||
632 | n2rng_driver_version(); | 635 | n2rng_driver_version(); |
633 | np = kzalloc(sizeof(*np), GFP_KERNEL); | 636 | np = kzalloc(sizeof(*np), GFP_KERNEL); |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index cc6c9b2546a3..64c6b8530615 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -2554,9 +2554,11 @@ static struct pci_driver ipmi_pci_driver = { | |||
2554 | }; | 2554 | }; |
2555 | #endif /* CONFIG_PCI */ | 2555 | #endif /* CONFIG_PCI */ |
2556 | 2556 | ||
2557 | static struct of_device_id ipmi_match[]; | ||
2557 | static int __devinit ipmi_probe(struct platform_device *dev) | 2558 | static int __devinit ipmi_probe(struct platform_device *dev) |
2558 | { | 2559 | { |
2559 | #ifdef CONFIG_OF | 2560 | #ifdef CONFIG_OF |
2561 | const struct of_device_id *match; | ||
2560 | struct smi_info *info; | 2562 | struct smi_info *info; |
2561 | struct resource resource; | 2563 | struct resource resource; |
2562 | const __be32 *regsize, *regspacing, *regshift; | 2564 | const __be32 *regsize, *regspacing, *regshift; |
@@ -2566,7 +2568,8 @@ static int __devinit ipmi_probe(struct platform_device *dev) | |||
2566 | 2568 | ||
2567 | dev_info(&dev->dev, "probing via device tree\n"); | 2569 | dev_info(&dev->dev, "probing via device tree\n"); |
2568 | 2570 | ||
2569 | if (!dev->dev.of_match) | 2571 | match = of_match_device(ipmi_match, &dev->dev); |
2572 | if (!match) | ||
2570 | return -EINVAL; | 2573 | return -EINVAL; |
2571 | 2574 | ||
2572 | ret = of_address_to_resource(np, 0, &resource); | 2575 | ret = of_address_to_resource(np, 0, &resource); |
@@ -2601,7 +2604,7 @@ static int __devinit ipmi_probe(struct platform_device *dev) | |||
2601 | return -ENOMEM; | 2604 | return -ENOMEM; |
2602 | } | 2605 | } |
2603 | 2606 | ||
2604 | info->si_type = (enum si_type) dev->dev.of_match->data; | 2607 | info->si_type = (enum si_type) match->data; |
2605 | info->addr_source = SI_DEVICETREE; | 2608 | info->addr_source = SI_DEVICETREE; |
2606 | info->irq_setup = std_irq_setup; | 2609 | info->irq_setup = std_irq_setup; |
2607 | 2610 | ||
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 436a99017998..8fc04b4f311f 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -806,29 +806,41 @@ static const struct file_operations oldmem_fops = { | |||
806 | }; | 806 | }; |
807 | #endif | 807 | #endif |
808 | 808 | ||
809 | static ssize_t kmsg_write(struct file *file, const char __user *buf, | 809 | static ssize_t kmsg_writev(struct kiocb *iocb, const struct iovec *iv, |
810 | size_t count, loff_t *ppos) | 810 | unsigned long count, loff_t pos) |
811 | { | 811 | { |
812 | char *tmp; | 812 | char *line, *p; |
813 | ssize_t ret; | 813 | int i; |
814 | ssize_t ret = -EFAULT; | ||
815 | size_t len = iov_length(iv, count); | ||
814 | 816 | ||
815 | tmp = kmalloc(count + 1, GFP_KERNEL); | 817 | line = kmalloc(len + 1, GFP_KERNEL); |
816 | if (tmp == NULL) | 818 | if (line == NULL) |
817 | return -ENOMEM; | 819 | return -ENOMEM; |
818 | ret = -EFAULT; | 820 | |
819 | if (!copy_from_user(tmp, buf, count)) { | 821 | /* |
820 | tmp[count] = 0; | 822 | * copy all vectors into a single string, to ensure we do |
821 | ret = printk("%s", tmp); | 823 | * not interleave our log line with other printk calls |
822 | if (ret > count) | 824 | */ |
823 | /* printk can add a prefix */ | 825 | p = line; |
824 | ret = count; | 826 | for (i = 0; i < count; i++) { |
827 | if (copy_from_user(p, iv[i].iov_base, iv[i].iov_len)) | ||
828 | goto out; | ||
829 | p += iv[i].iov_len; | ||
825 | } | 830 | } |
826 | kfree(tmp); | 831 | p[0] = '\0'; |
832 | |||
833 | ret = printk("%s", line); | ||
834 | /* printk can add a prefix */ | ||
835 | if (ret > len) | ||
836 | ret = len; | ||
837 | out: | ||
838 | kfree(line); | ||
827 | return ret; | 839 | return ret; |
828 | } | 840 | } |
829 | 841 | ||
830 | static const struct file_operations kmsg_fops = { | 842 | static const struct file_operations kmsg_fops = { |
831 | .write = kmsg_write, | 843 | .aio_write = kmsg_writev, |
832 | .llseek = noop_llseek, | 844 | .llseek = noop_llseek, |
833 | }; | 845 | }; |
834 | 846 | ||
diff --git a/drivers/char/raw.c b/drivers/char/raw.c index b4b9d5a47885..b33e8ea314ed 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
22 | #include <linux/gfp.h> | 22 | #include <linux/gfp.h> |
23 | #include <linux/compat.h> | 23 | #include <linux/compat.h> |
24 | #include <linux/vmalloc.h> | ||
24 | 25 | ||
25 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> |
26 | 27 | ||
@@ -30,10 +31,15 @@ struct raw_device_data { | |||
30 | }; | 31 | }; |
31 | 32 | ||
32 | static struct class *raw_class; | 33 | static struct class *raw_class; |
33 | static struct raw_device_data raw_devices[MAX_RAW_MINORS]; | 34 | static struct raw_device_data *raw_devices; |
34 | static DEFINE_MUTEX(raw_mutex); | 35 | static DEFINE_MUTEX(raw_mutex); |
35 | static const struct file_operations raw_ctl_fops; /* forward declaration */ | 36 | static const struct file_operations raw_ctl_fops; /* forward declaration */ |
36 | 37 | ||
38 | static int max_raw_minors = MAX_RAW_MINORS; | ||
39 | |||
40 | module_param(max_raw_minors, int, 0); | ||
41 | MODULE_PARM_DESC(max_raw_minors, "Maximum number of raw devices (1-65536)"); | ||
42 | |||
37 | /* | 43 | /* |
38 | * Open/close code for raw IO. | 44 | * Open/close code for raw IO. |
39 | * | 45 | * |
@@ -125,7 +131,7 @@ static int bind_set(int number, u64 major, u64 minor) | |||
125 | struct raw_device_data *rawdev; | 131 | struct raw_device_data *rawdev; |
126 | int err = 0; | 132 | int err = 0; |
127 | 133 | ||
128 | if (number <= 0 || number >= MAX_RAW_MINORS) | 134 | if (number <= 0 || number >= max_raw_minors) |
129 | return -EINVAL; | 135 | return -EINVAL; |
130 | 136 | ||
131 | if (MAJOR(dev) != major || MINOR(dev) != minor) | 137 | if (MAJOR(dev) != major || MINOR(dev) != minor) |
@@ -312,14 +318,27 @@ static int __init raw_init(void) | |||
312 | dev_t dev = MKDEV(RAW_MAJOR, 0); | 318 | dev_t dev = MKDEV(RAW_MAJOR, 0); |
313 | int ret; | 319 | int ret; |
314 | 320 | ||
315 | ret = register_chrdev_region(dev, MAX_RAW_MINORS, "raw"); | 321 | if (max_raw_minors < 1 || max_raw_minors > 65536) { |
322 | printk(KERN_WARNING "raw: invalid max_raw_minors (must be" | ||
323 | " between 1 and 65536), using %d\n", MAX_RAW_MINORS); | ||
324 | max_raw_minors = MAX_RAW_MINORS; | ||
325 | } | ||
326 | |||
327 | raw_devices = vmalloc(sizeof(struct raw_device_data) * max_raw_minors); | ||
328 | if (!raw_devices) { | ||
329 | printk(KERN_ERR "Not enough memory for raw device structures\n"); | ||
330 | ret = -ENOMEM; | ||
331 | goto error; | ||
332 | } | ||
333 | memset(raw_devices, 0, sizeof(struct raw_device_data) * max_raw_minors); | ||
334 | |||
335 | ret = register_chrdev_region(dev, max_raw_minors, "raw"); | ||
316 | if (ret) | 336 | if (ret) |
317 | goto error; | 337 | goto error; |
318 | 338 | ||
319 | cdev_init(&raw_cdev, &raw_fops); | 339 | cdev_init(&raw_cdev, &raw_fops); |
320 | ret = cdev_add(&raw_cdev, dev, MAX_RAW_MINORS); | 340 | ret = cdev_add(&raw_cdev, dev, max_raw_minors); |
321 | if (ret) { | 341 | if (ret) { |
322 | kobject_put(&raw_cdev.kobj); | ||
323 | goto error_region; | 342 | goto error_region; |
324 | } | 343 | } |
325 | 344 | ||
@@ -336,8 +355,9 @@ static int __init raw_init(void) | |||
336 | return 0; | 355 | return 0; |
337 | 356 | ||
338 | error_region: | 357 | error_region: |
339 | unregister_chrdev_region(dev, MAX_RAW_MINORS); | 358 | unregister_chrdev_region(dev, max_raw_minors); |
340 | error: | 359 | error: |
360 | vfree(raw_devices); | ||
341 | return ret; | 361 | return ret; |
342 | } | 362 | } |
343 | 363 | ||
@@ -346,7 +366,7 @@ static void __exit raw_exit(void) | |||
346 | device_destroy(raw_class, MKDEV(RAW_MAJOR, 0)); | 366 | device_destroy(raw_class, MKDEV(RAW_MAJOR, 0)); |
347 | class_destroy(raw_class); | 367 | class_destroy(raw_class); |
348 | cdev_del(&raw_cdev); | 368 | cdev_del(&raw_cdev); |
349 | unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS); | 369 | unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), max_raw_minors); |
350 | } | 370 | } |
351 | 371 | ||
352 | module_init(raw_init); | 372 | module_init(raw_init); |
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 84b164d1eb2b..838568a7dbf5 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -1280,18 +1280,7 @@ static void unplug_port(struct port *port) | |||
1280 | spin_lock_irq(&pdrvdata_lock); | 1280 | spin_lock_irq(&pdrvdata_lock); |
1281 | list_del(&port->cons.list); | 1281 | list_del(&port->cons.list); |
1282 | spin_unlock_irq(&pdrvdata_lock); | 1282 | spin_unlock_irq(&pdrvdata_lock); |
1283 | #if 0 | ||
1284 | /* | ||
1285 | * hvc_remove() not called as removing one hvc port | ||
1286 | * results in other hvc ports getting frozen. | ||
1287 | * | ||
1288 | * Once this is resolved in hvc, this functionality | ||
1289 | * will be enabled. Till that is done, the -EPIPE | ||
1290 | * return from get_chars() above will help | ||
1291 | * hvc_console.c to clean up on ports we remove here. | ||
1292 | */ | ||
1293 | hvc_remove(port->cons.hvc); | 1283 | hvc_remove(port->cons.hvc); |
1294 | #endif | ||
1295 | } | 1284 | } |
1296 | 1285 | ||
1297 | /* Remove unused data this port might have received. */ | 1286 | /* Remove unused data this port might have received. */ |
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c index d6412c16385f..39ccdeada791 100644 --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c | |||
@@ -715,13 +715,13 @@ static int __devexit hwicap_remove(struct device *dev) | |||
715 | } | 715 | } |
716 | 716 | ||
717 | #ifdef CONFIG_OF | 717 | #ifdef CONFIG_OF |
718 | static int __devinit hwicap_of_probe(struct platform_device *op) | 718 | static int __devinit hwicap_of_probe(struct platform_device *op, |
719 | const struct hwicap_driver_config *config) | ||
719 | { | 720 | { |
720 | struct resource res; | 721 | struct resource res; |
721 | const unsigned int *id; | 722 | const unsigned int *id; |
722 | const char *family; | 723 | const char *family; |
723 | int rc; | 724 | int rc; |
724 | const struct hwicap_driver_config *config = op->dev.of_match->data; | ||
725 | const struct config_registers *regs; | 725 | const struct config_registers *regs; |
726 | 726 | ||
727 | 727 | ||
@@ -751,20 +751,24 @@ static int __devinit hwicap_of_probe(struct platform_device *op) | |||
751 | regs); | 751 | regs); |
752 | } | 752 | } |
753 | #else | 753 | #else |
754 | static inline int hwicap_of_probe(struct platform_device *op) | 754 | static inline int hwicap_of_probe(struct platform_device *op, |
755 | const struct hwicap_driver_config *config) | ||
755 | { | 756 | { |
756 | return -EINVAL; | 757 | return -EINVAL; |
757 | } | 758 | } |
758 | #endif /* CONFIG_OF */ | 759 | #endif /* CONFIG_OF */ |
759 | 760 | ||
761 | static const struct of_device_id __devinitconst hwicap_of_match[]; | ||
760 | static int __devinit hwicap_drv_probe(struct platform_device *pdev) | 762 | static int __devinit hwicap_drv_probe(struct platform_device *pdev) |
761 | { | 763 | { |
764 | const struct of_device_id *match; | ||
762 | struct resource *res; | 765 | struct resource *res; |
763 | const struct config_registers *regs; | 766 | const struct config_registers *regs; |
764 | const char *family; | 767 | const char *family; |
765 | 768 | ||
766 | if (pdev->dev.of_match) | 769 | match = of_match_device(hwicap_of_match, &pdev->dev); |
767 | return hwicap_of_probe(pdev); | 770 | if (match) |
771 | return hwicap_of_probe(pdev, match->data); | ||
768 | 772 | ||
769 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 773 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
770 | if (!res) | 774 | if (!res) |