diff options
Diffstat (limited to 'fs/coda/psdev.c')
-rw-r--r-- | fs/coda/psdev.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index ebc2bae6c289..5c1e4242368b 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c | |||
@@ -114,14 +114,14 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf, | |||
114 | int size = sizeof(*dcbuf); | 114 | int size = sizeof(*dcbuf); |
115 | 115 | ||
116 | if ( nbytes < sizeof(struct coda_out_hdr) ) { | 116 | if ( nbytes < sizeof(struct coda_out_hdr) ) { |
117 | printk("coda_downcall opc %d uniq %d, not enough!\n", | 117 | pr_warn("coda_downcall opc %d uniq %d, not enough!\n", |
118 | hdr.opcode, hdr.unique); | 118 | hdr.opcode, hdr.unique); |
119 | count = nbytes; | 119 | count = nbytes; |
120 | goto out; | 120 | goto out; |
121 | } | 121 | } |
122 | if ( nbytes > size ) { | 122 | if ( nbytes > size ) { |
123 | printk("Coda: downcall opc %d, uniq %d, too much!", | 123 | pr_warn("downcall opc %d, uniq %d, too much!", |
124 | hdr.opcode, hdr.unique); | 124 | hdr.opcode, hdr.unique); |
125 | nbytes = size; | 125 | nbytes = size; |
126 | } | 126 | } |
127 | CODA_ALLOC(dcbuf, union outputArgs *, nbytes); | 127 | CODA_ALLOC(dcbuf, union outputArgs *, nbytes); |
@@ -136,7 +136,8 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf, | |||
136 | 136 | ||
137 | CODA_FREE(dcbuf, nbytes); | 137 | CODA_FREE(dcbuf, nbytes); |
138 | if (error) { | 138 | if (error) { |
139 | printk("psdev_write: coda_downcall error: %d\n", error); | 139 | pr_warn("%s: coda_downcall error: %d\n", |
140 | __func__, error); | ||
140 | retval = error; | 141 | retval = error; |
141 | goto out; | 142 | goto out; |
142 | } | 143 | } |
@@ -157,16 +158,17 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf, | |||
157 | mutex_unlock(&vcp->vc_mutex); | 158 | mutex_unlock(&vcp->vc_mutex); |
158 | 159 | ||
159 | if (!req) { | 160 | if (!req) { |
160 | printk("psdev_write: msg (%d, %d) not found\n", | 161 | pr_warn("%s: msg (%d, %d) not found\n", |
161 | hdr.opcode, hdr.unique); | 162 | __func__, hdr.opcode, hdr.unique); |
162 | retval = -ESRCH; | 163 | retval = -ESRCH; |
163 | goto out; | 164 | goto out; |
164 | } | 165 | } |
165 | 166 | ||
166 | /* move data into response buffer. */ | 167 | /* move data into response buffer. */ |
167 | if (req->uc_outSize < nbytes) { | 168 | if (req->uc_outSize < nbytes) { |
168 | printk("psdev_write: too much cnt: %d, cnt: %ld, opc: %d, uniq: %d.\n", | 169 | pr_warn("%s: too much cnt: %d, cnt: %ld, opc: %d, uniq: %d.\n", |
169 | req->uc_outSize, (long)nbytes, hdr.opcode, hdr.unique); | 170 | __func__, req->uc_outSize, (long)nbytes, |
171 | hdr.opcode, hdr.unique); | ||
170 | nbytes = req->uc_outSize; /* don't have more space! */ | 172 | nbytes = req->uc_outSize; /* don't have more space! */ |
171 | } | 173 | } |
172 | if (copy_from_user(req->uc_data, buf, nbytes)) { | 174 | if (copy_from_user(req->uc_data, buf, nbytes)) { |
@@ -240,8 +242,8 @@ static ssize_t coda_psdev_read(struct file * file, char __user * buf, | |||
240 | /* Move the input args into userspace */ | 242 | /* Move the input args into userspace */ |
241 | count = req->uc_inSize; | 243 | count = req->uc_inSize; |
242 | if (nbytes < req->uc_inSize) { | 244 | if (nbytes < req->uc_inSize) { |
243 | printk ("psdev_read: Venus read %ld bytes of %d in message\n", | 245 | pr_warn("%s: Venus read %ld bytes of %d in message\n", |
244 | (long)nbytes, req->uc_inSize); | 246 | __func__, (long)nbytes, req->uc_inSize); |
245 | count = nbytes; | 247 | count = nbytes; |
246 | } | 248 | } |
247 | 249 | ||
@@ -305,7 +307,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file) | |||
305 | struct upc_req *req, *tmp; | 307 | struct upc_req *req, *tmp; |
306 | 308 | ||
307 | if (!vcp || !vcp->vc_inuse ) { | 309 | if (!vcp || !vcp->vc_inuse ) { |
308 | printk("psdev_release: Not open.\n"); | 310 | pr_warn("%s: Not open.\n", __func__); |
309 | return -1; | 311 | return -1; |
310 | } | 312 | } |
311 | 313 | ||
@@ -354,8 +356,8 @@ static int init_coda_psdev(void) | |||
354 | { | 356 | { |
355 | int i, err = 0; | 357 | int i, err = 0; |
356 | if (register_chrdev(CODA_PSDEV_MAJOR, "coda", &coda_psdev_fops)) { | 358 | if (register_chrdev(CODA_PSDEV_MAJOR, "coda", &coda_psdev_fops)) { |
357 | printk(KERN_ERR "coda_psdev: unable to get major %d\n", | 359 | pr_err("%s: unable to get major %d\n", |
358 | CODA_PSDEV_MAJOR); | 360 | __func__, CODA_PSDEV_MAJOR); |
359 | return -EIO; | 361 | return -EIO; |
360 | } | 362 | } |
361 | coda_psdev_class = class_create(THIS_MODULE, "coda"); | 363 | coda_psdev_class = class_create(THIS_MODULE, "coda"); |
@@ -393,13 +395,13 @@ static int __init init_coda(void) | |||
393 | goto out2; | 395 | goto out2; |
394 | status = init_coda_psdev(); | 396 | status = init_coda_psdev(); |
395 | if ( status ) { | 397 | if ( status ) { |
396 | printk("Problem (%d) in init_coda_psdev\n", status); | 398 | pr_warn("Problem (%d) in init_coda_psdev\n", status); |
397 | goto out1; | 399 | goto out1; |
398 | } | 400 | } |
399 | 401 | ||
400 | status = register_filesystem(&coda_fs_type); | 402 | status = register_filesystem(&coda_fs_type); |
401 | if (status) { | 403 | if (status) { |
402 | printk("coda: failed to register filesystem!\n"); | 404 | pr_warn("failed to register filesystem!\n"); |
403 | goto out; | 405 | goto out; |
404 | } | 406 | } |
405 | return 0; | 407 | return 0; |
@@ -420,9 +422,8 @@ static void __exit exit_coda(void) | |||
420 | int err, i; | 422 | int err, i; |
421 | 423 | ||
422 | err = unregister_filesystem(&coda_fs_type); | 424 | err = unregister_filesystem(&coda_fs_type); |
423 | if ( err != 0 ) { | 425 | if (err != 0) |
424 | printk("coda: failed to unregister filesystem\n"); | 426 | pr_warn("failed to unregister filesystem\n"); |
425 | } | ||
426 | for (i = 0; i < MAX_CODADEVS; i++) | 427 | for (i = 0; i < MAX_CODADEVS; i++) |
427 | device_destroy(coda_psdev_class, MKDEV(CODA_PSDEV_MAJOR, i)); | 428 | device_destroy(coda_psdev_class, MKDEV(CODA_PSDEV_MAJOR, i)); |
428 | class_destroy(coda_psdev_class); | 429 | class_destroy(coda_psdev_class); |