From patchwork Thu Apr 14 13:02:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 65821 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp585110qge; Thu, 14 Apr 2016 06:03:01 -0700 (PDT) X-Received: by 10.98.8.91 with SMTP id c88mr20939000pfd.47.1460638980921; Thu, 14 Apr 2016 06:03:00 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 84si6860976pfc.6.2016.04.14.06.03.00; Thu, 14 Apr 2016 06:03:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755518AbcDNNC7 (ORCPT + 29 others); Thu, 14 Apr 2016 09:02:59 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:38596 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754396AbcDNNCY (ORCPT ); Thu, 14 Apr 2016 09:02:24 -0400 Received: by mail-wm0-f49.google.com with SMTP id u206so124618895wme.1 for ; Thu, 14 Apr 2016 06:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lP1HdvswCApkVL7EM+z4bWWGj12edGLOw+XArjhO38g=; b=iu0Z58qOxAzNeYDCqzkl3FiuqVKqOtGcJlDmvgigdFRttv9KI5ELrXs/84r2CyT2wm cD8dMOr/Wl1F15ExIZelra6GkFOUAA23eHbd2bPzyjow9ipcGeRozaIxfqu2oWpj7cuY EpBvFFv2kTJbRL0GrHGk+N8GGeJeCHcYjSClg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lP1HdvswCApkVL7EM+z4bWWGj12edGLOw+XArjhO38g=; b=k2FIVcQ+UKSiA+xwfyGImMouhH64vXH4YhJtw+QNLUl7EFmt90HmjXwXm/k8O7iRuu szf1pn433n4sBA1UmXGWqQDW7/eq8Dldj7hQq/KgzHxDkDtKP3Is4cw386nUZFUoJf7n vRLgyNxRfoiP3ZzUgVsSrZobM2uB7C/W9k1l3Wuyq9FcWGSn6knZ9uNO95xckwaONhVM JxI1PjD+2TUi5sjvBT/42052zdThWAoN5d2UZchw8kzrU6VP5gs2baKIRoVP1uNFbNsK j4iXhHWsOHsHVr5iB00tB/4geJsmJB0l+qsGz9jlejnu0UkJLvmWPpg8cJ313GxoZeZo FAvA== X-Gm-Message-State: AOPr4FWZ24BluHswmKldWypYqbds0xy39t1oZeQ1DytHJHhC5MvNiXSQvWTN2f60RF8GnWDh X-Received: by 10.28.48.147 with SMTP id w141mr15976133wmw.85.1460638943230; Thu, 14 Apr 2016 06:02:23 -0700 (PDT) Received: from localhost.localdomain (host-92-17-247-99.as13285.net. [92.17.247.99]) by smtp.gmail.com with ESMTPSA id g78sm33438402wme.21.2016.04.14.06.02.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Apr 2016 06:02:22 -0700 (PDT) From: Srinivas Kandagatla To: Ulf Hansson , linux-mmc@vger.kernel.org Cc: Srinivas Kandagatla , linux-kernel@vger.kernel.org, mfuzzey@parkeon.com Subject: [PATCH v4 2/3] mmc: pwrseq_emmc: add to_pwrseq_emmc() macro Date: Thu, 14 Apr 2016 14:02:15 +0100 Message-Id: <1460638936-26990-3-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460638936-26990-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1460638936-26990-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds to_pwrseq_emmc() macro to make the code more readable. Signed-off-by: Srinivas Kandagatla --- drivers/mmc/core/pwrseq_emmc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.5.0 diff --git a/drivers/mmc/core/pwrseq_emmc.c b/drivers/mmc/core/pwrseq_emmc.c index 4a82bc7..c2d732a 100644 --- a/drivers/mmc/core/pwrseq_emmc.c +++ b/drivers/mmc/core/pwrseq_emmc.c @@ -25,6 +25,8 @@ struct mmc_pwrseq_emmc { struct gpio_desc *reset_gpio; }; +#define to_pwrseq_emmc(p) container_of(p, struct mmc_pwrseq_emmc, pwrseq) + static void __mmc_pwrseq_emmc_reset(struct mmc_pwrseq_emmc *pwrseq) { gpiod_set_value(pwrseq->reset_gpio, 1); @@ -35,16 +37,14 @@ static void __mmc_pwrseq_emmc_reset(struct mmc_pwrseq_emmc *pwrseq) static void mmc_pwrseq_emmc_reset(struct mmc_host *host) { - struct mmc_pwrseq_emmc *pwrseq = container_of(host->pwrseq, - struct mmc_pwrseq_emmc, pwrseq); + struct mmc_pwrseq_emmc *pwrseq = to_pwrseq_emmc(host->pwrseq); __mmc_pwrseq_emmc_reset(pwrseq); } static void mmc_pwrseq_emmc_free(struct mmc_host *host) { - struct mmc_pwrseq_emmc *pwrseq = container_of(host->pwrseq, - struct mmc_pwrseq_emmc, pwrseq); + struct mmc_pwrseq_emmc *pwrseq = to_pwrseq_emmc(host->pwrseq); unregister_restart_handler(&pwrseq->reset_nb); gpiod_put(pwrseq->reset_gpio);