aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtd_blkdevs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/mtd_blkdevs.c')
-rw-r--r--drivers/mtd/mtd_blkdevs.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index d6cb3d194efb..339cb1218eaa 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: mtd_blkdevs.c,v 1.26 2005/07/29 19:42:04 tpoynor Exp $ 2 * $Id: mtd_blkdevs.c,v 1.27 2005/11/07 11:14:20 gleixner Exp $
3 * 3 *
4 * (C) 2003 David Woodhouse <dwmw2@infradead.org> 4 * (C) 2003 David Woodhouse <dwmw2@infradead.org>
5 * 5 *
@@ -85,7 +85,7 @@ static int mtd_blktrans_thread(void *arg)
85 daemonize("%sd", tr->name); 85 daemonize("%sd", tr->name);
86 86
87 /* daemonize() doesn't do this for us since some kernel threads 87 /* daemonize() doesn't do this for us since some kernel threads
88 actually want to deal with signals. We can't just call 88 actually want to deal with signals. We can't just call
89 exit_sighand() since that'll cause an oops when we finally 89 exit_sighand() since that'll cause an oops when we finally
90 do exit. */ 90 do exit. */
91 spin_lock_irq(&current->sighand->siglock); 91 spin_lock_irq(&current->sighand->siglock);
@@ -94,7 +94,7 @@ static int mtd_blktrans_thread(void *arg)
94 spin_unlock_irq(&current->sighand->siglock); 94 spin_unlock_irq(&current->sighand->siglock);
95 95
96 spin_lock_irq(rq->queue_lock); 96 spin_lock_irq(rq->queue_lock);
97 97
98 while (!tr->blkcore_priv->exiting) { 98 while (!tr->blkcore_priv->exiting) {
99 struct request *req; 99 struct request *req;
100 struct mtd_blktrans_dev *dev; 100 struct mtd_blktrans_dev *dev;
@@ -157,7 +157,7 @@ static int blktrans_open(struct inode *i, struct file *f)
157 if (!try_module_get(tr->owner)) 157 if (!try_module_get(tr->owner))
158 goto out_tr; 158 goto out_tr;
159 159
160 /* FIXME: Locking. A hot pluggable device can go away 160 /* FIXME: Locking. A hot pluggable device can go away
161 (del_mtd_device can be called for it) without its module 161 (del_mtd_device can be called for it) without its module
162 being unloaded. */ 162 being unloaded. */
163 dev->mtd->usecount++; 163 dev->mtd->usecount++;
@@ -195,7 +195,7 @@ static int blktrans_release(struct inode *i, struct file *f)
195} 195}
196 196
197 197
198static int blktrans_ioctl(struct inode *inode, struct file *file, 198static int blktrans_ioctl(struct inode *inode, struct file *file,
199 unsigned int cmd, unsigned long arg) 199 unsigned int cmd, unsigned long arg)
200{ 200{
201 struct mtd_blktrans_dev *dev = inode->i_bdev->bd_disk->private_data; 201 struct mtd_blktrans_dev *dev = inode->i_bdev->bd_disk->private_data;
@@ -264,7 +264,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
264 /* Required number was free */ 264 /* Required number was free */
265 list_add_tail(&new->list, &d->list); 265 list_add_tail(&new->list, &d->list);
266 goto added; 266 goto added;
267 } 267 }
268 last_devnum = d->devnum; 268 last_devnum = d->devnum;
269 } 269 }
270 if (new->devnum == -1) 270 if (new->devnum == -1)
@@ -288,7 +288,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
288 gd->major = tr->major; 288 gd->major = tr->major;
289 gd->first_minor = (new->devnum) << tr->part_bits; 289 gd->first_minor = (new->devnum) << tr->part_bits;
290 gd->fops = &mtd_blktrans_ops; 290 gd->fops = &mtd_blktrans_ops;
291 291
292 if (tr->part_bits) 292 if (tr->part_bits)
293 if (new->devnum < 26) 293 if (new->devnum < 26)
294 snprintf(gd->disk_name, sizeof(gd->disk_name), 294 snprintf(gd->disk_name, sizeof(gd->disk_name),
@@ -314,7 +314,7 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
314 set_disk_ro(gd, 1); 314 set_disk_ro(gd, 1);
315 315
316 add_disk(gd); 316 add_disk(gd);
317 317
318 return 0; 318 return 0;
319} 319}
320 320
@@ -329,7 +329,7 @@ int del_mtd_blktrans_dev(struct mtd_blktrans_dev *old)
329 329
330 del_gendisk(old->blkcore_priv); 330 del_gendisk(old->blkcore_priv);
331 put_disk(old->blkcore_priv); 331 put_disk(old->blkcore_priv);
332 332
333 return 0; 333 return 0;
334} 334}
335 335
@@ -368,12 +368,12 @@ static struct mtd_notifier blktrans_notifier = {
368 .add = blktrans_notify_add, 368 .add = blktrans_notify_add,
369 .remove = blktrans_notify_remove, 369 .remove = blktrans_notify_remove,
370}; 370};
371 371
372int register_mtd_blktrans(struct mtd_blktrans_ops *tr) 372int register_mtd_blktrans(struct mtd_blktrans_ops *tr)
373{ 373{
374 int ret, i; 374 int ret, i;
375 375
376 /* Register the notifier if/when the first device type is 376 /* Register the notifier if/when the first device type is
377 registered, to prevent the link/init ordering from fucking 377 registered, to prevent the link/init ordering from fucking
378 us over. */ 378 us over. */
379 if (!blktrans_notifier.list.next) 379 if (!blktrans_notifier.list.next)
@@ -416,7 +416,7 @@ int register_mtd_blktrans(struct mtd_blktrans_ops *tr)
416 kfree(tr->blkcore_priv); 416 kfree(tr->blkcore_priv);
417 up(&mtd_table_mutex); 417 up(&mtd_table_mutex);
418 return ret; 418 return ret;
419 } 419 }
420 420
421 INIT_LIST_HEAD(&tr->devs); 421 INIT_LIST_HEAD(&tr->devs);
422 list_add(&tr->list, &blktrans_majors); 422 list_add(&tr->list, &blktrans_majors);