提交 b4cc580b 编写于 作者: U Ulf Hansson

mmc: slot-gpio: Use the parent device while allocating data

We had a mix of using the class device and the parent device while
allocating data through the devm_* managed functions.

Let's be more consistent and always use the parent device.
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 eddbc3ab
...@@ -52,7 +52,7 @@ static int mmc_gpio_alloc(struct mmc_host *host) ...@@ -52,7 +52,7 @@ static int mmc_gpio_alloc(struct mmc_host *host)
* before device_add(), i.e., between mmc_alloc_host() and * before device_add(), i.e., between mmc_alloc_host() and
* mmc_add_host() * mmc_add_host()
*/ */
ctx = devm_kzalloc(&host->class_dev, sizeof(*ctx) + 2 * len, ctx = devm_kzalloc(host->parent, sizeof(*ctx) + 2 * len,
GFP_KERNEL); GFP_KERNEL);
if (ctx) { if (ctx) {
ctx->ro_label = ctx->cd_label + len; ctx->ro_label = ctx->cd_label + len;
...@@ -121,7 +121,7 @@ int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio) ...@@ -121,7 +121,7 @@ int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio)
ctx = host->slot.handler_priv; ctx = host->slot.handler_priv;
ret = devm_gpio_request_one(&host->class_dev, gpio, GPIOF_DIR_IN, ret = devm_gpio_request_one(host->parent, gpio, GPIOF_DIR_IN,
ctx->ro_label); ctx->ro_label);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -152,7 +152,7 @@ void mmc_gpiod_request_cd_irq(struct mmc_host *host) ...@@ -152,7 +152,7 @@ void mmc_gpiod_request_cd_irq(struct mmc_host *host)
irq = -EINVAL; irq = -EINVAL;
if (irq >= 0) { if (irq >= 0) {
ret = devm_request_threaded_irq(&host->class_dev, irq, ret = devm_request_threaded_irq(host->parent, irq,
NULL, mmc_gpio_cd_irqt, NULL, mmc_gpio_cd_irqt,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
ctx->cd_label, host); ctx->cd_label, host);
...@@ -194,7 +194,7 @@ int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio, ...@@ -194,7 +194,7 @@ int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio,
ctx = host->slot.handler_priv; ctx = host->slot.handler_priv;
ret = devm_gpio_request_one(&host->class_dev, gpio, GPIOF_DIR_IN, ret = devm_gpio_request_one(host->parent, gpio, GPIOF_DIR_IN,
ctx->cd_label); ctx->cd_label);
if (ret < 0) if (ret < 0)
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册