diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-21 12:42:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-21 12:42:58 -0400 |
commit | 1fc149933fd49a5b0e7738dc0853dbfbac4ae0e1 (patch) | |
tree | dfe99751c21aaf39e49765379d0b9b32114c757d /drivers/char | |
parent | 41d5e08ea86af3359239d5a6f7021cdc61beaa49 (diff) | |
parent | ea5505fabd3b59608750bfd3721d0f8bc5c8b0bb (diff) |
Merge tag 'char-misc-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH:
"Here's the big char/misc driver patchset for 4.1-rc1.
Lots of different driver subsystem updates here, nothing major, full
details are in the shortlog.
All of this has been in linux-next for a while"
* tag 'char-misc-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (133 commits)
mei: trace: remove unused TRACE_SYSTEM_STRING
DTS: ARM: OMAP3-N900: Add lis3lv02d support
Documentation: DT: lis302: update wakeup binding
lis3lv02d: DT: add wakeup unit 2 and wakeup threshold
lis3lv02d: DT: use s32 to support negative values
Drivers: hv: hv_balloon: correctly handle num_pages>INT_MAX case
Drivers: hv: hv_balloon: correctly handle val.freeram<num_pages case
mei: replace check for connection instead of transitioning
mei: use mei_cl_is_connected consistently
mei: fix mei_poll operation
hv_vmbus: Add gradually increased delay for retries in vmbus_post_msg()
Drivers: hv: hv_balloon: survive ballooning request with num_pages=0
Drivers: hv: hv_balloon: eliminate jumps in piecewiese linear floor function
Drivers: hv: hv_balloon: do not online pages in offline blocks
hv: remove the per-channel workqueue
hv: don't schedule new works in vmbus_onoffer()/vmbus_onoffer_rescind()
hv: run non-blocking message handlers in the dispatch tasklet
coresight: moving to new "hwtracing" directory
coresight-tmc: Adding a status interface to sysfs
coresight: remove the unnecessary configuration coresight-default-sink
...
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/hw_random/core.c | 34 | ||||
-rw-r--r-- | drivers/char/hw_random/pasemi-rng.c | 2 | ||||
-rw-r--r-- | drivers/char/hw_random/powernv-rng.c | 2 | ||||
-rw-r--r-- | drivers/char/hw_random/ppc4xx-rng.c | 2 | ||||
-rw-r--r-- | drivers/char/i8k.c | 16 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 4 | ||||
-rw-r--r-- | drivers/char/misc.c | 20 | ||||
-rw-r--r-- | drivers/char/virtio_console.c | 2 | ||||
-rw-r--r-- | drivers/char/xillybus/xillybus_core.c | 2 | ||||
-rw-r--r-- | drivers/char/xillybus/xillybus_of.c | 2 |
10 files changed, 43 insertions, 43 deletions
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 571ef61f8ea9..da8faf78536a 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c | |||
@@ -300,11 +300,14 @@ static const struct file_operations rng_chrdev_ops = { | |||
300 | .llseek = noop_llseek, | 300 | .llseek = noop_llseek, |
301 | }; | 301 | }; |
302 | 302 | ||
303 | static const struct attribute_group *rng_dev_groups[]; | ||
304 | |||
303 | static struct miscdevice rng_miscdev = { | 305 | static struct miscdevice rng_miscdev = { |
304 | .minor = RNG_MISCDEV_MINOR, | 306 | .minor = RNG_MISCDEV_MINOR, |
305 | .name = RNG_MODULE_NAME, | 307 | .name = RNG_MODULE_NAME, |
306 | .nodename = "hwrng", | 308 | .nodename = "hwrng", |
307 | .fops = &rng_chrdev_ops, | 309 | .fops = &rng_chrdev_ops, |
310 | .groups = rng_dev_groups, | ||
308 | }; | 311 | }; |
309 | 312 | ||
310 | 313 | ||
@@ -377,37 +380,22 @@ static DEVICE_ATTR(rng_available, S_IRUGO, | |||
377 | hwrng_attr_available_show, | 380 | hwrng_attr_available_show, |
378 | NULL); | 381 | NULL); |
379 | 382 | ||
383 | static struct attribute *rng_dev_attrs[] = { | ||
384 | &dev_attr_rng_current.attr, | ||
385 | &dev_attr_rng_available.attr, | ||
386 | NULL | ||
387 | }; | ||
388 | |||
389 | ATTRIBUTE_GROUPS(rng_dev); | ||
380 | 390 | ||
381 | static void __exit unregister_miscdev(void) | 391 | static void __exit unregister_miscdev(void) |
382 | { | 392 | { |
383 | device_remove_file(rng_miscdev.this_device, &dev_attr_rng_available); | ||
384 | device_remove_file(rng_miscdev.this_device, &dev_attr_rng_current); | ||
385 | misc_deregister(&rng_miscdev); | 393 | misc_deregister(&rng_miscdev); |
386 | } | 394 | } |
387 | 395 | ||
388 | static int __init register_miscdev(void) | 396 | static int __init register_miscdev(void) |
389 | { | 397 | { |
390 | int err; | 398 | return misc_register(&rng_miscdev); |
391 | |||
392 | err = misc_register(&rng_miscdev); | ||
393 | if (err) | ||
394 | goto out; | ||
395 | err = device_create_file(rng_miscdev.this_device, | ||
396 | &dev_attr_rng_current); | ||
397 | if (err) | ||
398 | goto err_misc_dereg; | ||
399 | err = device_create_file(rng_miscdev.this_device, | ||
400 | &dev_attr_rng_available); | ||
401 | if (err) | ||
402 | goto err_remove_current; | ||
403 | out: | ||
404 | return err; | ||
405 | |||
406 | err_remove_current: | ||
407 | device_remove_file(rng_miscdev.this_device, &dev_attr_rng_current); | ||
408 | err_misc_dereg: | ||
409 | misc_deregister(&rng_miscdev); | ||
410 | goto out; | ||
411 | } | 399 | } |
412 | 400 | ||
413 | static int hwrng_fillfn(void *unused) | 401 | static int hwrng_fillfn(void *unused) |
diff --git a/drivers/char/hw_random/pasemi-rng.c b/drivers/char/hw_random/pasemi-rng.c index 3eb7bdd7f93b..51cb1d5cc489 100644 --- a/drivers/char/hw_random/pasemi-rng.c +++ b/drivers/char/hw_random/pasemi-rng.c | |||
@@ -133,7 +133,7 @@ static int rng_remove(struct platform_device *dev) | |||
133 | return 0; | 133 | return 0; |
134 | } | 134 | } |
135 | 135 | ||
136 | static struct of_device_id rng_match[] = { | 136 | static const struct of_device_id rng_match[] = { |
137 | { .compatible = "1682m-rng", }, | 137 | { .compatible = "1682m-rng", }, |
138 | { .compatible = "pasemi,pwrficient-rng", }, | 138 | { .compatible = "pasemi,pwrficient-rng", }, |
139 | { }, | 139 | { }, |
diff --git a/drivers/char/hw_random/powernv-rng.c b/drivers/char/hw_random/powernv-rng.c index 3f4f63204560..263a5bb8e605 100644 --- a/drivers/char/hw_random/powernv-rng.c +++ b/drivers/char/hw_random/powernv-rng.c | |||
@@ -61,7 +61,7 @@ static int powernv_rng_probe(struct platform_device *pdev) | |||
61 | return 0; | 61 | return 0; |
62 | } | 62 | } |
63 | 63 | ||
64 | static struct of_device_id powernv_rng_match[] = { | 64 | static const struct of_device_id powernv_rng_match[] = { |
65 | { .compatible = "ibm,power-rng",}, | 65 | { .compatible = "ibm,power-rng",}, |
66 | {}, | 66 | {}, |
67 | }; | 67 | }; |
diff --git a/drivers/char/hw_random/ppc4xx-rng.c b/drivers/char/hw_random/ppc4xx-rng.c index c85d31a5f9e3..b2cfda0fa93e 100644 --- a/drivers/char/hw_random/ppc4xx-rng.c +++ b/drivers/char/hw_random/ppc4xx-rng.c | |||
@@ -123,7 +123,7 @@ static int ppc4xx_rng_remove(struct platform_device *dev) | |||
123 | return 0; | 123 | return 0; |
124 | } | 124 | } |
125 | 125 | ||
126 | static struct of_device_id ppc4xx_rng_match[] = { | 126 | static const struct of_device_id ppc4xx_rng_match[] = { |
127 | { .compatible = "ppc4xx-rng", }, | 127 | { .compatible = "ppc4xx-rng", }, |
128 | { .compatible = "amcc,ppc460ex-rng", }, | 128 | { .compatible = "amcc,ppc460ex-rng", }, |
129 | { .compatible = "amcc,ppc440epx-rng", }, | 129 | { .compatible = "amcc,ppc440epx-rng", }, |
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index 24cc4ed9a780..a43048b5b05f 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c | |||
@@ -510,13 +510,15 @@ static int i8k_proc_show(struct seq_file *seq, void *offset) | |||
510 | * 9) AC power | 510 | * 9) AC power |
511 | * 10) Fn Key status | 511 | * 10) Fn Key status |
512 | */ | 512 | */ |
513 | return seq_printf(seq, "%s %s %s %d %d %d %d %d %d %d\n", | 513 | seq_printf(seq, "%s %s %s %d %d %d %d %d %d %d\n", |
514 | I8K_PROC_FMT, | 514 | I8K_PROC_FMT, |
515 | bios_version, | 515 | bios_version, |
516 | i8k_get_dmi_data(DMI_PRODUCT_SERIAL), | 516 | i8k_get_dmi_data(DMI_PRODUCT_SERIAL), |
517 | cpu_temp, | 517 | cpu_temp, |
518 | left_fan, right_fan, left_speed, right_speed, | 518 | left_fan, right_fan, left_speed, right_speed, |
519 | ac_power, fn_key); | 519 | ac_power, fn_key); |
520 | |||
521 | return 0; | ||
520 | } | 522 | } |
521 | 523 | ||
522 | static int i8k_open_fs(struct inode *inode, struct file *file) | 524 | static int i8k_open_fs(struct inode *inode, struct file *file) |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 518585c1ce94..5e90a18afbaf 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -2667,7 +2667,7 @@ static struct pci_driver ipmi_pci_driver = { | |||
2667 | }; | 2667 | }; |
2668 | #endif /* CONFIG_PCI */ | 2668 | #endif /* CONFIG_PCI */ |
2669 | 2669 | ||
2670 | static struct of_device_id ipmi_match[]; | 2670 | static const struct of_device_id ipmi_match[]; |
2671 | static int ipmi_probe(struct platform_device *dev) | 2671 | static int ipmi_probe(struct platform_device *dev) |
2672 | { | 2672 | { |
2673 | #ifdef CONFIG_OF | 2673 | #ifdef CONFIG_OF |
@@ -2764,7 +2764,7 @@ static int ipmi_remove(struct platform_device *dev) | |||
2764 | return 0; | 2764 | return 0; |
2765 | } | 2765 | } |
2766 | 2766 | ||
2767 | static struct of_device_id ipmi_match[] = | 2767 | static const struct of_device_id ipmi_match[] = |
2768 | { | 2768 | { |
2769 | { .type = "ipmi", .compatible = "ipmi-kcs", | 2769 | { .type = "ipmi", .compatible = "ipmi-kcs", |
2770 | .data = (void *)(unsigned long) SI_KCS }, | 2770 | .data = (void *)(unsigned long) SI_KCS }, |
diff --git a/drivers/char/misc.c b/drivers/char/misc.c index ffa97d261cf3..9fd5a91e0d81 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c | |||
@@ -140,12 +140,17 @@ static int misc_open(struct inode * inode, struct file * file) | |||
140 | goto fail; | 140 | goto fail; |
141 | } | 141 | } |
142 | 142 | ||
143 | /* | ||
144 | * Place the miscdevice in the file's | ||
145 | * private_data so it can be used by the | ||
146 | * file operations, including f_op->open below | ||
147 | */ | ||
148 | file->private_data = c; | ||
149 | |||
143 | err = 0; | 150 | err = 0; |
144 | replace_fops(file, new_fops); | 151 | replace_fops(file, new_fops); |
145 | if (file->f_op->open) { | 152 | if (file->f_op->open) |
146 | file->private_data = c; | ||
147 | err = file->f_op->open(inode,file); | 153 | err = file->f_op->open(inode,file); |
148 | } | ||
149 | fail: | 154 | fail: |
150 | mutex_unlock(&misc_mtx); | 155 | mutex_unlock(&misc_mtx); |
151 | return err; | 156 | return err; |
@@ -169,7 +174,9 @@ static const struct file_operations misc_fops = { | |||
169 | * the minor number requested is used. | 174 | * the minor number requested is used. |
170 | * | 175 | * |
171 | * The structure passed is linked into the kernel and may not be | 176 | * The structure passed is linked into the kernel and may not be |
172 | * destroyed until it has been unregistered. | 177 | * destroyed until it has been unregistered. By default, an open() |
178 | * syscall to the device sets file->private_data to point to the | ||
179 | * structure. Drivers don't need open in fops for this. | ||
173 | * | 180 | * |
174 | * A zero is returned on success and a negative errno code for | 181 | * A zero is returned on success and a negative errno code for |
175 | * failure. | 182 | * failure. |
@@ -205,8 +212,9 @@ int misc_register(struct miscdevice * misc) | |||
205 | 212 | ||
206 | dev = MKDEV(MISC_MAJOR, misc->minor); | 213 | dev = MKDEV(MISC_MAJOR, misc->minor); |
207 | 214 | ||
208 | misc->this_device = device_create(misc_class, misc->parent, dev, | 215 | misc->this_device = |
209 | misc, "%s", misc->name); | 216 | device_create_with_groups(misc_class, misc->parent, dev, |
217 | misc, misc->groups, "%s", misc->name); | ||
210 | if (IS_ERR(misc->this_device)) { | 218 | if (IS_ERR(misc->this_device)) { |
211 | int i = DYNAMIC_MINORS - misc->minor - 1; | 219 | int i = DYNAMIC_MINORS - misc->minor - 1; |
212 | if (i < DYNAMIC_MINORS && i >= 0) | 220 | if (i < DYNAMIC_MINORS && i >= 0) |
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 72d7028f779b..50754d203310 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -355,7 +355,7 @@ static inline bool use_multiport(struct ports_device *portdev) | |||
355 | * early_init | 355 | * early_init |
356 | */ | 356 | */ |
357 | if (!portdev->vdev) | 357 | if (!portdev->vdev) |
358 | return 0; | 358 | return false; |
359 | return __virtio_test_bit(portdev->vdev, VIRTIO_CONSOLE_F_MULTIPORT); | 359 | return __virtio_test_bit(portdev->vdev, VIRTIO_CONSOLE_F_MULTIPORT); |
360 | } | 360 | } |
361 | 361 | ||
diff --git a/drivers/char/xillybus/xillybus_core.c b/drivers/char/xillybus/xillybus_core.c index b827fa095f1b..77d6c127e691 100644 --- a/drivers/char/xillybus/xillybus_core.c +++ b/drivers/char/xillybus/xillybus_core.c | |||
@@ -1237,6 +1237,8 @@ static ssize_t xillybus_write(struct file *filp, const char __user *userbuf, | |||
1237 | unsigned char *tail; | 1237 | unsigned char *tail; |
1238 | int i; | 1238 | int i; |
1239 | 1239 | ||
1240 | howmany = 0; | ||
1241 | |||
1240 | end_offset_plus1 = bufpos >> | 1242 | end_offset_plus1 = bufpos >> |
1241 | channel->log2_element_size; | 1243 | channel->log2_element_size; |
1242 | 1244 | ||
diff --git a/drivers/char/xillybus/xillybus_of.c b/drivers/char/xillybus/xillybus_of.c index 2002a3a28146..781865084dc1 100644 --- a/drivers/char/xillybus/xillybus_of.c +++ b/drivers/char/xillybus/xillybus_of.c | |||
@@ -31,7 +31,7 @@ MODULE_LICENSE("GPL v2"); | |||
31 | static const char xillyname[] = "xillybus_of"; | 31 | static const char xillyname[] = "xillybus_of"; |
32 | 32 | ||
33 | /* Match table for of_platform binding */ | 33 | /* Match table for of_platform binding */ |
34 | static struct of_device_id xillybus_of_match[] = { | 34 | static const struct of_device_id xillybus_of_match[] = { |
35 | { .compatible = "xillybus,xillybus-1.00.a", }, | 35 | { .compatible = "xillybus,xillybus-1.00.a", }, |
36 | { .compatible = "xlnx,xillybus-1.00.a", }, /* Deprecated */ | 36 | { .compatible = "xlnx,xillybus-1.00.a", }, /* Deprecated */ |
37 | {} | 37 | {} |