From patchwork Thu Dec 18 14:44:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 42459 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D445726C8B for ; Thu, 18 Dec 2014 14:44:58 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id hs14sf861065lab.1 for ; Thu, 18 Dec 2014 06:44:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=80jmr2BQNuv/8nVK3NBw1mvR7IvK/uqACU0cFpizP2k=; b=JBFP0StwzF8B1OxWPNWo9sBYU+zTV26EwF/R8l8dLYkkTnZtBVQtwKDEbxve9Lo8uz j0WqD9yNTA9kL70HEpHXuJubpFkWYpqwK7OpcUfmqapZgrCQEpKo5Pg0vFsxZXKamLqb 2DBJrGkMuP6oUUabuVhB2840bngyArx0tODZqw3xwnFm01BWN1ZdGX91KqAk3WuQniRT 6Zb2tJYOkeQS8DofWVX99oQ3xK1JJMpMUReCvQwDV+b4NNXPTTh4kCLHbGMMw+PANsD/ T79Ghqy1+vjrnNFLjvLGKkApwtsbYYq/BbiAJPhnwUqPiU796OL7CHiSdRV4dzuHmfNk HXeQ== X-Gm-Message-State: ALoCoQmw3U6uIY72StMoHe+azAa411HHsgXda1tPpnxBTHBB6WoDnqqCMl855cuFwDugxfwV4e7w X-Received: by 10.112.188.199 with SMTP id gc7mr385414lbc.6.1418913897739; Thu, 18 Dec 2014 06:44:57 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.26.200 with SMTP id n8ls589913lag.15.gmail; Thu, 18 Dec 2014 06:44:57 -0800 (PST) X-Received: by 10.152.2.41 with SMTP id 9mr2539562lar.47.1418913897396; Thu, 18 Dec 2014 06:44:57 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id pn4si7120808lbc.33.2014.12.18.06.44.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 06:44:57 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id p9so1065857lbv.7 for ; Thu, 18 Dec 2014 06:44:57 -0800 (PST) X-Received: by 10.152.87.12 with SMTP id t12mr2623120laz.31.1418913897319; Thu, 18 Dec 2014 06:44:57 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp1728706lbb; Thu, 18 Dec 2014 06:44:56 -0800 (PST) X-Received: by 10.180.90.165 with SMTP id bx5mr25559508wib.15.1418913891696; Thu, 18 Dec 2014 06:44:51 -0800 (PST) Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com. [74.125.82.49]) by mx.google.com with ESMTPS id m6si12254416wjy.122.2014.12.18.06.44.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 06:44:51 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 74.125.82.49 as permitted sender) client-ip=74.125.82.49; Received: by mail-wg0-f49.google.com with SMTP id n12so1819735wgh.22 for ; Thu, 18 Dec 2014 06:44:51 -0800 (PST) X-Received: by 10.195.12.35 with SMTP id en3mr5014897wjd.129.1418913891298; Thu, 18 Dec 2014 06:44:51 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id a14sm25013698wib.22.2014.12.18.06.44.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Dec 2014 06:44:50 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Chris Ball Subject: [PATCH 4/7] mmc: slot-gpio: Use the parent device while allocating data Date: Thu, 18 Dec 2014 15:44:33 +0100 Message-Id: <1418913876-13937-5-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1418913876-13937-1-git-send-email-ulf.hansson@linaro.org> References: <1418913876-13937-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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: Ulf Hansson --- drivers/mmc/core/slot-gpio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c index a428f10..f9a0c6e 100644 --- a/drivers/mmc/core/slot-gpio.c +++ b/drivers/mmc/core/slot-gpio.c @@ -52,7 +52,7 @@ static int mmc_gpio_alloc(struct mmc_host *host) * before device_add(), i.e., between mmc_alloc_host() and * mmc_add_host() */ - ctx = devm_kzalloc(&host->class_dev, sizeof(*ctx) + 2 * len, + ctx = devm_kzalloc(host->parent, sizeof(*ctx) + 2 * len, GFP_KERNEL); if (ctx) { ctx->ro_label = ctx->cd_label + len; @@ -121,7 +121,7 @@ int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio) 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); if (ret < 0) return ret; @@ -152,7 +152,7 @@ void mmc_gpiod_request_cd_irq(struct mmc_host *host) irq = -EINVAL; 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, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, ctx->cd_label, host); @@ -194,7 +194,7 @@ int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio, 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); if (ret < 0) /*