aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/viotape.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-29 04:02:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:22 -0400
commit1b50221738108c438d5f25c7a043fb89e9e27044 (patch)
tree510b2baf0675fee9ce450b6756ff36c77e2f626c /drivers/char/viotape.c
parent0fd689468231cb5eee9cc5d6331081b77c7a7a76 (diff)
drivers: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data be setup before gluing PDE to main tree. Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/viotape.c')
-rw-r--r--drivers/char/viotape.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index db7a731e2362..58aad63831f4 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -249,6 +249,7 @@ static int proc_viotape_open(struct inode *inode, struct file *file)
249} 249}
250 250
251static const struct file_operations proc_viotape_operations = { 251static const struct file_operations proc_viotape_operations = {
252 .owner = THIS_MODULE,
252 .open = proc_viotape_open, 253 .open = proc_viotape_open,
253 .read = seq_read, 254 .read = seq_read,
254 .llseek = seq_lseek, 255 .llseek = seq_lseek,
@@ -915,7 +916,6 @@ static struct vio_driver viotape_driver = {
915int __init viotap_init(void) 916int __init viotap_init(void)
916{ 917{
917 int ret; 918 int ret;
918 struct proc_dir_entry *e;
919 919
920 if (!firmware_has_feature(FW_FEATURE_ISERIES)) 920 if (!firmware_has_feature(FW_FEATURE_ISERIES))
921 return -ENODEV; 921 return -ENODEV;
@@ -968,11 +968,8 @@ int __init viotap_init(void)
968 if (ret) 968 if (ret)
969 goto unreg_class; 969 goto unreg_class;
970 970
971 e = create_proc_entry("iSeries/viotape", S_IFREG|S_IRUGO, NULL); 971 proc_create("iSeries/viotape", S_IFREG|S_IRUGO, NULL,
972 if (e) { 972 &proc_viotape_operations);
973 e->owner = THIS_MODULE;
974 e->proc_fops = &proc_viotape_operations;
975 }
976 973
977 return 0; 974 return 0;
978 975