mmc: Fix use of wrong device in mmc_gpiod_free_cd()
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 23 Sep 2014 20:00:25 +0000 (23:00 +0300)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 29 Sep 2014 09:27:51 +0000 (11:27 +0200)
mmc_gpiod_free_cd() is paired with mmc_gpiod_request_cd()
and both must reference the same device which is the
actual host controller device not the mmc_host class
device.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/slot-gpio.c

index 3af30e94fd0c2d538c4f65627d603cf1ae61380c..38f76555d4bf7b9094d05be5052bd2560a9be4bd 100644 (file)
@@ -390,7 +390,7 @@ void mmc_gpiod_free_cd(struct mmc_host *host)
                host->slot.cd_irq = -EINVAL;
        }
 
-       devm_gpiod_put(&host->class_dev, ctx->cd_gpio);
+       devm_gpiod_put(host->parent, ctx->cd_gpio);
 
        ctx->cd_gpio = NULL;
 }