From 9b86bdf96ef79e5e286628cb2e3ea6639db71904 Mon Sep 17 00:00:00 2001
From: Phong Tran <tranmanphong@gmail.com>
Date: Fri, 26 Jun 2015 21:05:12 +0700
Subject: [PATCH] greybus: sdio: change the order of remove and free mmc host

The mmc host should be removed frist. Then it
will be freed.

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
---
 drivers/staging/greybus/sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/sdio.c b/drivers/staging/greybus/sdio.c
index 16abf7cafd902..cf12592d34680 100644
--- a/drivers/staging/greybus/sdio.c
+++ b/drivers/staging/greybus/sdio.c
@@ -700,8 +700,8 @@ static void gb_sdio_connection_exit(struct gb_connection *connection)
 
 	flush_workqueue(gb_sdio_mrq_workqueue);
 	destroy_workqueue(gb_sdio_mrq_workqueue);
-	mmc_free_host(mmc);
 	mmc_remove_host(mmc);
+	mmc_free_host(mmc);
 	kfree(host->xfer_buffer);
 }
 
-- 
2.30.2