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: 5514261 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D6CD99F326 for ; Thu, 18 Dec 2014 14:44:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A9C720A29 for ; Thu, 18 Dec 2014 14:44:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D74820A26 for ; Thu, 18 Dec 2014 14:44:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752295AbaLROoy (ORCPT ); Thu, 18 Dec 2014 09:44:54 -0500 Received: from mail-wg0-f50.google.com ([74.125.82.50]:37363 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751833AbaLROow (ORCPT ); Thu, 18 Dec 2014 09:44:52 -0500 Received: by mail-wg0-f50.google.com with SMTP id a1so1820757wgh.23 for ; Thu, 18 Dec 2014 06:44:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=80jmr2BQNuv/8nVK3NBw1mvR7IvK/uqACU0cFpizP2k=; b=S2J3vcMHMtJWxmA7zLyjn+86YKwpbx3ukcu4H1T9kXqdxooTxuzcS9OaiVZWc2p6tY BWXs9mnH7AnlVY4G5a0KmWgJEYTsXK3gavHRvIp0p4h0eRDdZyHnwqHGESNKNaI8Xy/p O/K+8FxOz95bb5V164oLzHBmCSzIlkzaHFV2Ixamt4N7mD8wkbbuwPVaq7Vglzkeh1ou 1vMhdXPwnU1FdZJ9ohTDSKHeJ8vbm8Lh4t3EjX9Dbkmof59kDJWdjwL3FEcHv4jpVihs ViRmD1HhhVgEDkpHoQ2uCsQbNFQPFs4nc+/Foq7IFxiSeZcd7FFUs13ciJVveE91XByC mCxw== X-Gm-Message-State: ALoCoQnq4oKrXdFlg3TNvyxiR8p7dd/9C+BOkzq8DV7MnKiZmoUGgcip8sR0Nxe0LTzNt2i4JCuH 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> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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) /*