From patchwork Wed Mar 2 16:45:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 63400 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2483515lbc; Wed, 2 Mar 2016 08:45:42 -0800 (PST) X-Received: by 10.98.70.67 with SMTP id t64mr2185899pfa.110.1456937141902; Wed, 02 Mar 2016 08:45:41 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pz7si20573955pab.216.2016.03.02.08.45.41; Wed, 02 Mar 2016 08:45:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754263AbcCBQpj (ORCPT + 2 others); Wed, 2 Mar 2016 11:45:39 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:38866 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753694AbcCBQpi (ORCPT ); Wed, 2 Mar 2016 11:45:38 -0500 Received: by mail-wm0-f51.google.com with SMTP id l68so86144741wml.1 for ; Wed, 02 Mar 2016 08:45:38 -0800 (PST) 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=g5go7k70z+j3xBtO7cEoygVecpRLbdg+/we8J1uq8QA=; b=LCo9N55kkbB/wm14DjfWETHXm1Q+3i9o2JgDx9/WNIsLI1kr+2DItN0ft76d7srH6N AXCa4qlS/l8WUpviRFy0TwK1Ls7U9Hgc9l2+m0EJwSRTHENNWOPkFjT0D4w7Y9KlOmeb Tw0lfJL4JosqPktEgaeR4wsrnXXdmmBq30oxo= 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=g5go7k70z+j3xBtO7cEoygVecpRLbdg+/we8J1uq8QA=; b=ZleAPrNU3E8DOkjPXgzj9zbi/gL6dsHTpKzfz/dGA8+s3j9FLBx0jSRlLIRQQb3nFc 5nswnrsGF84mYVcscTgUFGxwaf6VixzkCFkPFmqMftgR/ddY+WA0D00zpzBIqM7sOn+L XapVNdJYtJ2J2dvh+h+EdyuZ/DpmqvKPBiFFfjuDvtTYGA8BJl2EnpIrX1Fopm3rvgbk SsOGS+DaxFD6QARVs3VZi1x/Etdf985Lee10kLRBMjv0Ta/lz6Yy5/itbIJIIoeKAvc/ iSFZ1u3DGxOYM9CtSKHbJxgOwrS68v5T67x5qy3Qv6GpF8owgLHBZJqrT19E3tSWiHPK UjTg== X-Gm-Message-State: AD7BkJKFFumkjiUZAf9z3MRfqAuGqTsODCxvqPxpNKJDHv4fbheNAgPJa3zsPRU+wLQQTqNA X-Received: by 10.28.30.198 with SMTP id e189mr896531wme.60.1456937137455; Wed, 02 Mar 2016 08:45:37 -0800 (PST) Received: from localhost.localdomain (host-92-17-247-99.as13285.net. [92.17.247.99]) by smtp.gmail.com with ESMTPSA id lz5sm36568533wjb.5.2016.03.02.08.45.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Mar 2016 08:45:36 -0800 (PST) From: Srinivas Kandagatla To: Ulf Hansson , linux-mmc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, mfuzzey@parkeon.com, Srinivas Kandagatla Subject: [PATCH v2 2/3] mmc: pwrseq_emmc: add to_pwrseq_emmc() macro Date: Wed, 2 Mar 2016 16:45:20 +0000 Message-Id: <1456937120-27328-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456937078-27241-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1456937078-27241-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);