Commit 9bed00f2 authored by David Cross's avatar David Cross Committed by Greg Kroah-Hartman

staging: west bridge, block driver change for partition support

This patch fixes an error in the block driver wherein multiple
partitions in an mmc card were not detected correctly due to
incorrect alloc_disk arguments.
Signed-off-by: default avatarDavid Cross <david.cross@cypress.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 54930e88
...@@ -403,7 +403,7 @@ int cyasblkdev_media_changed(struct gendisk *gd) ...@@ -403,7 +403,7 @@ int cyasblkdev_media_changed(struct gendisk *gd)
} }
/* return media change state "1" yes, 0 no */ /* return media change state "1" yes, 0 no */
return 1; return 0;
} }
/* this one called by kernel to give us a chence /* this one called by kernel to give us a chence
...@@ -1111,7 +1111,8 @@ static int cyasblkdev_add_disks(int bus_num, ...@@ -1111,7 +1111,8 @@ static int cyasblkdev_add_disks(int bus_num,
* public partition beginning */ * public partition beginning */
if (vfat_search) { if (vfat_search) {
bd->user_disk_0_first_sector = bd->user_disk_0_first_sector =
cyasblkdev_get_vfat_offset(0, cyasblkdev_get_vfat_offset(
bd->user_disk_0_bus_num,
bd->user_disk_0_unit_no); bd->user_disk_0_unit_no);
} else { } else {
bd->user_disk_0_first_sector = 0; bd->user_disk_0_first_sector = 0;
...@@ -1244,7 +1245,8 @@ static int cyasblkdev_add_disks(int bus_num, ...@@ -1244,7 +1245,8 @@ static int cyasblkdev_add_disks(int bus_num,
if (vfat_search) { if (vfat_search) {
bd->user_disk_1_first_sector = bd->user_disk_1_first_sector =
cyasblkdev_get_vfat_offset( cyasblkdev_get_vfat_offset(
1, bd->user_disk_1_unit_no); bd->user_disk_1_bus_num,
bd->user_disk_1_unit_no);
} else { } else {
bd->user_disk_1_first_sector bd->user_disk_1_first_sector
= 0; = 0;
...@@ -1256,8 +1258,8 @@ static int cyasblkdev_add_disks(int bus_num, ...@@ -1256,8 +1258,8 @@ static int cyasblkdev_add_disks(int bus_num,
if (lcl_unit_no > 0) { if (lcl_unit_no > 0) {
if (bd->system_disk == NULL) { if (bd->system_disk == NULL) {
bd->system_disk = bd->system_disk =
alloc_disk(CYASBLKDEV_MINOR_2 alloc_disk(8);
<< CYASBLKDEV_SHIFT);
if (bd->system_disk == NULL) { if (bd->system_disk == NULL) {
kfree(bd); kfree(bd);
bd = ERR_PTR(-ENOMEM); bd = ERR_PTR(-ENOMEM);
...@@ -1423,8 +1425,7 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void) ...@@ -1423,8 +1425,7 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
if (bd->user_disk_0 == NULL) { if (bd->user_disk_0 == NULL) {
bd->user_disk_0 = bd->user_disk_0 =
alloc_disk(CYASBLKDEV_MINOR_0 alloc_disk(8);
<< CYASBLKDEV_SHIFT);
if (bd->user_disk_0 == NULL) { if (bd->user_disk_0 == NULL) {
kfree(bd); kfree(bd);
bd = ERR_PTR(-ENOMEM); bd = ERR_PTR(-ENOMEM);
...@@ -1443,8 +1444,7 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void) ...@@ -1443,8 +1444,7 @@ static struct cyasblkdev_blk_data *cyasblkdev_blk_alloc(void)
if (total_media_count == 2) { if (total_media_count == 2) {
if (bd->user_disk_1 == NULL) { if (bd->user_disk_1 == NULL) {
bd->user_disk_1 = bd->user_disk_1 =
alloc_disk(CYASBLKDEV_MINOR_1 alloc_disk(8);
<< CYASBLKDEV_SHIFT);
if (bd->user_disk_1 == NULL) { if (bd->user_disk_1 == NULL) {
kfree(bd); kfree(bd);
bd = ERR_PTR(-ENOMEM); bd = ERR_PTR(-ENOMEM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment