diff options
Diffstat (limited to 'drivers/s390/char/monwriter.c')
-rw-r--r-- | drivers/s390/char/monwriter.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c index 66fb8eba93f4..98a49dfda1de 100644 --- a/drivers/s390/char/monwriter.c +++ b/drivers/s390/char/monwriter.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/moduleparam.h> | 13 | #include <linux/moduleparam.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
16 | #include <linux/smp_lock.h> | ||
17 | #include <linux/types.h> | 16 | #include <linux/types.h> |
18 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
19 | #include <linux/miscdevice.h> | 18 | #include <linux/miscdevice.h> |
@@ -21,6 +20,7 @@ | |||
21 | #include <linux/poll.h> | 20 | #include <linux/poll.h> |
22 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
23 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/slab.h> | ||
24 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
25 | #include <asm/ebcdic.h> | 25 | #include <asm/ebcdic.h> |
26 | #include <asm/io.h> | 26 | #include <asm/io.h> |
@@ -185,13 +185,11 @@ static int monwrite_open(struct inode *inode, struct file *filp) | |||
185 | monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL); | 185 | monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL); |
186 | if (!monpriv) | 186 | if (!monpriv) |
187 | return -ENOMEM; | 187 | return -ENOMEM; |
188 | lock_kernel(); | ||
189 | INIT_LIST_HEAD(&monpriv->list); | 188 | INIT_LIST_HEAD(&monpriv->list); |
190 | monpriv->hdr_to_read = sizeof(monpriv->hdr); | 189 | monpriv->hdr_to_read = sizeof(monpriv->hdr); |
191 | mutex_init(&monpriv->thread_mutex); | 190 | mutex_init(&monpriv->thread_mutex); |
192 | filp->private_data = monpriv; | 191 | filp->private_data = monpriv; |
193 | list_add_tail(&monpriv->priv_list, &mon_priv_list); | 192 | list_add_tail(&monpriv->priv_list, &mon_priv_list); |
194 | unlock_kernel(); | ||
195 | return nonseekable_open(inode, filp); | 193 | return nonseekable_open(inode, filp); |
196 | } | 194 | } |
197 | 195 | ||
@@ -326,7 +324,7 @@ static int monwriter_thaw(struct device *dev) | |||
326 | return monwriter_restore(dev); | 324 | return monwriter_restore(dev); |
327 | } | 325 | } |
328 | 326 | ||
329 | static struct dev_pm_ops monwriter_pm_ops = { | 327 | static const struct dev_pm_ops monwriter_pm_ops = { |
330 | .freeze = monwriter_freeze, | 328 | .freeze = monwriter_freeze, |
331 | .thaw = monwriter_thaw, | 329 | .thaw = monwriter_thaw, |
332 | .restore = monwriter_restore, | 330 | .restore = monwriter_restore, |
@@ -364,6 +362,10 @@ static int __init mon_init(void) | |||
364 | goto out_driver; | 362 | goto out_driver; |
365 | } | 363 | } |
366 | 364 | ||
365 | /* | ||
366 | * misc_register() has to be the last action in module_init(), because | ||
367 | * file operations will be available right after this. | ||
368 | */ | ||
367 | rc = misc_register(&mon_dev); | 369 | rc = misc_register(&mon_dev); |
368 | if (rc) | 370 | if (rc) |
369 | goto out_device; | 371 | goto out_device; |