mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Cross <david.cross@cypress.com>
To: greg@kroah.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] west bridge, block driver change for partition support
Date: Tue, 05 Oct 2010 18:50:26 -0700	[thread overview]
Message-ID: <1286329826.9470.14.camel@odc-laptop> (raw)
In-Reply-To: <1286329688.9470.11.camel@odc-laptop>

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: David Cross <david.cross@cypress.com>
---
diff -uprN -X linux-next-vanilla/Documentation/dontdiff linux-next-vanilla/drivers/staging/westbridge/astoria/block/cyasblkdev_block.c linux-next-incremen/drivers/staging/westbridge/astoria/block/cyasblkdev_block.c
--- linux-next-vanilla/drivers/staging/westbridge/astoria/block/cyasblkdev_block.c	2010-10-04 21:56:31.000000000 -0700
+++ linux-next-incremen/drivers/staging/westbridge/astoria/block/cyasblkdev_block.c	2010-10-05 16:35:07.000000000 -0700
@@ -403,7 +403,7 @@ int cyasblkdev_media_changed(struct gend
 	}
 
 	/* return media change state "1" yes, 0 no */
-	return 1;
+	return 0;
 }
 
 /*  this one called by kernel to give us a chence
@@ -1111,7 +1111,8 @@ static int cyasblkdev_add_disks(int bus_
 		 * public partition beginning */
 		if (vfat_search) {
 			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);
 		} else {
 			bd->user_disk_0_first_sector = 0;
@@ -1244,7 +1245,8 @@ static int cyasblkdev_add_disks(int bus_
 		if (vfat_search) {
 			bd->user_disk_1_first_sector =
 				cyasblkdev_get_vfat_offset(
-					1, bd->user_disk_1_unit_no);
+					bd->user_disk_1_bus_num,
+					bd->user_disk_1_unit_no);
 		} else {
 			bd->user_disk_1_first_sector
 				= 0;
@@ -1256,8 +1258,8 @@ static int cyasblkdev_add_disks(int bus_
 	if (lcl_unit_no > 0) {
 		if (bd->system_disk == NULL) {
 			bd->system_disk =
-				alloc_disk(CYASBLKDEV_MINOR_2
-					<< CYASBLKDEV_SHIFT);
+				alloc_disk(8);
+
 			if (bd->system_disk == NULL) {
 				kfree(bd);
 				bd = ERR_PTR(-ENOMEM);
@@ -1423,8 +1425,7 @@ static struct cyasblkdev_blk_data *cyasb
 			if (bd->user_disk_0 == NULL) {
 
 				bd->user_disk_0 =
-					alloc_disk(CYASBLKDEV_MINOR_0
-						<< CYASBLKDEV_SHIFT);
+					alloc_disk(8);
 				if (bd->user_disk_0 == NULL) {
 					kfree(bd);
 					bd = ERR_PTR(-ENOMEM);
@@ -1443,8 +1444,7 @@ static struct cyasblkdev_blk_data *cyasb
 		if (total_media_count == 2) {
 			if (bd->user_disk_1 == NULL) {
 				bd->user_disk_1 =
-					alloc_disk(CYASBLKDEV_MINOR_1
-						<< CYASBLKDEV_SHIFT);
+					alloc_disk(8);
 				if (bd->user_disk_1 == NULL) {
 					kfree(bd);
 					bd = ERR_PTR(-ENOMEM);


---------------------------------------------------------------
This message and any attachments may contain Cypress (or its
subsidiaries) confidential information. If it has been received
in error, please advise the sender and immediately delete this
message.
---------------------------------------------------------------


      reply	other threads:[~2010-10-06  1:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-24  0:20 [PATCH] west bridge, cyasgadget fix for usb_gadget_probe_driver David Cross
2010-09-30  1:37 ` Staging: " Greg KH
     [not found] ` <1285287885.17888.7.camel@odc-laptop>
2010-10-06  1:44   ` [PATCH] west bridge cyasgadget, removal of " " before ";" David Cross
2010-10-06  1:48 ` [PATCH] west bridge, addition of common lock on cyasdevice David Cross
2010-10-06  1:50   ` David Cross [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1286329826.9470.14.camel@odc-laptop \
    --to=david.cross@cypress.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®