From patchwork Wed Apr 13 17:54:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 65750 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp149373qge; Wed, 13 Apr 2016 10:55:24 -0700 (PDT) X-Received: by 10.98.25.196 with SMTP id 187mr12131574pfz.111.1460570124321; Wed, 13 Apr 2016 10:55:24 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fn9si2743144pab.163.2016.04.13.10.55.24; Wed, 13 Apr 2016 10:55:24 -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 S1754674AbcDMRzP (ORCPT + 29 others); Wed, 13 Apr 2016 13:55:15 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:36634 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754623AbcDMRyt (ORCPT ); Wed, 13 Apr 2016 13:54:49 -0400 Received: by mail-wm0-f45.google.com with SMTP id v188so187214934wme.1 for ; Wed, 13 Apr 2016 10:54:49 -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=TFqDqzP/qKSULRxtCGRjvnQG4XClAjGDJXy5Pa6o/knn+Gbkbox0YCbP/BVNVDY5YI GuRPM/56svjxCuPdYXqa62k1SsKzRE8bkAqY56nSpQZZ32ffA5PabzU9U+cCtN1EDeYn 66oEJIcRlx2UDyv1uSe7FJ+k/QfVZ6lu01MvA= 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=jCxT2AOwQhqKQ6ue9nbHg7Jk2KSvwlExAGAKNI9jUe/zpGmS6GalPpTzuO0AjJdm06 PoJZ1DbKJGoz2ySDxgghUG09bObmPUXV5y4GbLjCEJrqo2OrniV7C7wMAoNeDFcoQTOr 8vvGozWdMHnlGBSQoCCh4wzbvVqvGhqnrcc25Q1O6wX1k2N+Rx6K8Ve5OMAacW7xdcsh C/73f7ojhvR5LsFq3F7hhkpGfjHhRuUohLhRCo31WeeEA0HBEJiJtdfwmzm509pqMfhg fFMvLM9xLd+fJv0AFcZM0OiZtsTZ3oIZQts55BV2atE2gByBIhCBuv5ZIBi9zGAq+S0I NEzg== X-Gm-Message-State: AOPr4FWb2vWX1lLokJxld56f0MgfBcSITlQquqLAWodUPF1xKGYbf6kya2U9rrnljRnzisIc X-Received: by 10.194.90.229 with SMTP id bz5mr12058029wjb.143.1460570088434; Wed, 13 Apr 2016 10:54:48 -0700 (PDT) Received: from localhost.localdomain (host-92-17-247-99.as13285.net. [92.17.247.99]) by smtp.gmail.com with ESMTPSA id by7sm39750289wjc.18.2016.04.13.10.54.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Apr 2016 10:54:47 -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 v3 2/3] mmc: pwrseq_emmc: add to_pwrseq_emmc() macro Date: Wed, 13 Apr 2016 18:54:40 +0100 Message-Id: <1460570081-1679-3-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460570081-1679-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1460570081-1679-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);