diff options
Diffstat (limited to 'drivers/mtd/ubi/gluebi.c')
-rw-r--r-- | drivers/mtd/ubi/gluebi.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/mtd/ubi/gluebi.c b/drivers/mtd/ubi/gluebi.c index 4e44bee4c564..4bd4db8c84c9 100644 --- a/drivers/mtd/ubi/gluebi.c +++ b/drivers/mtd/ubi/gluebi.c | |||
@@ -41,7 +41,7 @@ | |||
41 | #include "ubi-media.h" | 41 | #include "ubi-media.h" |
42 | 42 | ||
43 | #define err_msg(fmt, ...) \ | 43 | #define err_msg(fmt, ...) \ |
44 | printk(KERN_DEBUG "gluebi (pid %d): %s: " fmt "\n", \ | 44 | pr_err("gluebi (pid %d): %s: " fmt "\n", \ |
45 | current->pid, __func__, ##__VA_ARGS__) | 45 | current->pid, __func__, ##__VA_ARGS__) |
46 | 46 | ||
47 | /** | 47 | /** |
@@ -341,9 +341,8 @@ static int gluebi_create(struct ubi_device_info *di, | |||
341 | mutex_lock(&devices_mutex); | 341 | mutex_lock(&devices_mutex); |
342 | g = find_gluebi_nolock(vi->ubi_num, vi->vol_id); | 342 | g = find_gluebi_nolock(vi->ubi_num, vi->vol_id); |
343 | if (g) | 343 | if (g) |
344 | err_msg("gluebi MTD device %d form UBI device %d volume %d " | 344 | err_msg("gluebi MTD device %d form UBI device %d volume %d already exists", |
345 | "already exists", g->mtd.index, vi->ubi_num, | 345 | g->mtd.index, vi->ubi_num, vi->vol_id); |
346 | vi->vol_id); | ||
347 | mutex_unlock(&devices_mutex); | 346 | mutex_unlock(&devices_mutex); |
348 | 347 | ||
349 | if (mtd_device_register(mtd, NULL, 0)) { | 348 | if (mtd_device_register(mtd, NULL, 0)) { |
@@ -376,8 +375,8 @@ static int gluebi_remove(struct ubi_volume_info *vi) | |||
376 | mutex_lock(&devices_mutex); | 375 | mutex_lock(&devices_mutex); |
377 | gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id); | 376 | gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id); |
378 | if (!gluebi) { | 377 | if (!gluebi) { |
379 | err_msg("got remove notification for unknown UBI device %d " | 378 | err_msg("got remove notification for unknown UBI device %d volume %d", |
380 | "volume %d", vi->ubi_num, vi->vol_id); | 379 | vi->ubi_num, vi->vol_id); |
381 | err = -ENOENT; | 380 | err = -ENOENT; |
382 | } else if (gluebi->refcnt) | 381 | } else if (gluebi->refcnt) |
383 | err = -EBUSY; | 382 | err = -EBUSY; |
@@ -390,9 +389,8 @@ static int gluebi_remove(struct ubi_volume_info *vi) | |||
390 | mtd = &gluebi->mtd; | 389 | mtd = &gluebi->mtd; |
391 | err = mtd_device_unregister(mtd); | 390 | err = mtd_device_unregister(mtd); |
392 | if (err) { | 391 | if (err) { |
393 | err_msg("cannot remove fake MTD device %d, UBI device %d, " | 392 | err_msg("cannot remove fake MTD device %d, UBI device %d, volume %d, error %d", |
394 | "volume %d, error %d", mtd->index, gluebi->ubi_num, | 393 | mtd->index, gluebi->ubi_num, gluebi->vol_id, err); |
395 | gluebi->vol_id, err); | ||
396 | mutex_lock(&devices_mutex); | 394 | mutex_lock(&devices_mutex); |
397 | list_add_tail(&gluebi->list, &gluebi_devices); | 395 | list_add_tail(&gluebi->list, &gluebi_devices); |
398 | mutex_unlock(&devices_mutex); | 396 | mutex_unlock(&devices_mutex); |
@@ -422,8 +420,8 @@ static int gluebi_updated(struct ubi_volume_info *vi) | |||
422 | gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id); | 420 | gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id); |
423 | if (!gluebi) { | 421 | if (!gluebi) { |
424 | mutex_unlock(&devices_mutex); | 422 | mutex_unlock(&devices_mutex); |
425 | err_msg("got update notification for unknown UBI device %d " | 423 | err_msg("got update notification for unknown UBI device %d volume %d", |
426 | "volume %d", vi->ubi_num, vi->vol_id); | 424 | vi->ubi_num, vi->vol_id); |
427 | return -ENOENT; | 425 | return -ENOENT; |
428 | } | 426 | } |
429 | 427 | ||
@@ -449,8 +447,8 @@ static int gluebi_resized(struct ubi_volume_info *vi) | |||
449 | gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id); | 447 | gluebi = find_gluebi_nolock(vi->ubi_num, vi->vol_id); |
450 | if (!gluebi) { | 448 | if (!gluebi) { |
451 | mutex_unlock(&devices_mutex); | 449 | mutex_unlock(&devices_mutex); |
452 | err_msg("got update notification for unknown UBI device %d " | 450 | err_msg("got update notification for unknown UBI device %d volume %d", |
453 | "volume %d", vi->ubi_num, vi->vol_id); | 451 | vi->ubi_num, vi->vol_id); |
454 | return -ENOENT; | 452 | return -ENOENT; |
455 | } | 453 | } |
456 | gluebi->mtd.size = vi->used_bytes; | 454 | gluebi->mtd.size = vi->used_bytes; |
@@ -507,9 +505,9 @@ static void __exit ubi_gluebi_exit(void) | |||
507 | 505 | ||
508 | err = mtd_device_unregister(mtd); | 506 | err = mtd_device_unregister(mtd); |
509 | if (err) | 507 | if (err) |
510 | err_msg("error %d while removing gluebi MTD device %d, " | 508 | err_msg("error %d while removing gluebi MTD device %d, UBI device %d, volume %d - ignoring", |
511 | "UBI device %d, volume %d - ignoring", err, | 509 | err, mtd->index, gluebi->ubi_num, |
512 | mtd->index, gluebi->ubi_num, gluebi->vol_id); | 510 | gluebi->vol_id); |
513 | kfree(mtd->name); | 511 | kfree(mtd->name); |
514 | kfree(gluebi); | 512 | kfree(gluebi); |
515 | } | 513 | } |