aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/vmu-flash.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/mtd/maps/vmu-flash.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/mtd/maps/vmu-flash.c')
-rw-r--r--drivers/mtd/maps/vmu-flash.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/maps/vmu-flash.c b/drivers/mtd/maps/vmu-flash.c
index 1f73297e7776..4afc167731ef 100644
--- a/drivers/mtd/maps/vmu-flash.c
+++ b/drivers/mtd/maps/vmu-flash.c
@@ -8,6 +8,7 @@
8 * GNU General Public Licence 8 * GNU General Public Licence
9 */ 9 */
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/slab.h>
11#include <linux/sched.h> 12#include <linux/sched.h>
12#include <linux/delay.h> 13#include <linux/delay.h>
13#include <linux/maple.h> 14#include <linux/maple.h>
@@ -612,16 +613,15 @@ static int __devinit vmu_connect(struct maple_device *mdev)
612 613
613 test_flash_data = be32_to_cpu(mdev->devinfo.function); 614 test_flash_data = be32_to_cpu(mdev->devinfo.function);
614 /* Need to count how many bits are set - to find out which 615 /* Need to count how many bits are set - to find out which
615 * function_data element has details of the memory card: 616 * function_data element has details of the memory card
616 * using Brian Kernighan's/Peter Wegner's method */ 617 */
617 for (c = 0; test_flash_data; c++) 618 c = hweight_long(test_flash_data);
618 test_flash_data &= test_flash_data - 1;
619 619
620 basic_flash_data = be32_to_cpu(mdev->devinfo.function_data[c - 1]); 620 basic_flash_data = be32_to_cpu(mdev->devinfo.function_data[c - 1]);
621 621
622 card = kmalloc(sizeof(struct memcard), GFP_KERNEL); 622 card = kmalloc(sizeof(struct memcard), GFP_KERNEL);
623 if (!card) { 623 if (!card) {
624 error = ENOMEM; 624 error = -ENOMEM;
625 goto fail_nomem; 625 goto fail_nomem;
626 } 626 }
627 627