mtd: maps: vmu-flash: Fix the (mtd core) switch to ref counters
[platform/kernel/linux-rpi.git] / drivers / mtd / maps / vmu-flash.c
index a7ec947..53019d3 100644 (file)
@@ -719,7 +719,7 @@ static int vmu_can_unload(struct maple_device *mdev)
        card = maple_get_drvdata(mdev);
        for (x = 0; x < card->partitions; x++) {
                mtd = &((card->mtd)[x]);
-               if (mtd->usecount > 0)
+               if (kref_read(&mtd->refcnt))
                        return 0;
        }
        return 1;