From patchwork Wed Jan 20 10:46:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 60027 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp3095847lbb; Wed, 20 Jan 2016 02:46:38 -0800 (PST) X-Received: by 10.67.1.102 with SMTP id bf6mr51726240pad.103.1453286798138; Wed, 20 Jan 2016 02:46:38 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uj10si2471437pac.79.2016.01.20.02.46.37; Wed, 20 Jan 2016 02:46:38 -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 S935140AbcATKqg (ORCPT + 2 others); Wed, 20 Jan 2016 05:46:36 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:37055 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935007AbcATKqc (ORCPT ); Wed, 20 Jan 2016 05:46:32 -0500 Received: by mail-wm0-f52.google.com with SMTP id n5so22327494wmn.0 for ; Wed, 20 Jan 2016 02:46:32 -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=guKQJIuvjDpsyhspqHkRBcKcKQ8ZhLPcS5FN2BWR9C1FWc7QnBbw3HUpSUSR5ePJwL Shmgy3LB+IWXp0DTOILhh75EWS/Jp3GIK11B4k82mmBkvnHlbrfENbNUx4DEc3Xb4/C0 SMzyZPzVf2hoE9VcYnr0D8NpU8N0esKJPfSC4= 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=ZRRJIjWXD6zpwLh9C1MXQ41S8y9VEfM+IOpbnG+yB0+B5ehKj6jKYsHpfowmXTGPCe YP/+CvVprpwgCcDa8dd8hXiKrSaDaYBVJehtUgDGjcOfrnE1hqaeg9HVg/BCdifCCQSt UXRErBpn4Ls/S+6Ys9pKkF9wz8q2eWQudFR70LKmcAYf3wZNbpgPD/62+aJNTtasY01r ISoQpuTI7kh1/DjeyliHXrAwuI85mrAvgDXnBRSkVCIwREu6vwGPYAmI+3oeloTxn0SS b3L6oMqgRL8WUm7SueTr0Hhhi4Ih/YqJ/GYTPCMZ2nXugSuNwGJNnztuh7DT9hywuv6+ zlgQ== X-Gm-Message-State: AG10YOR8rG/jY+0tc0ouR7tPnK2bSmXQgSXFkpY0309KbvzSCUrGusiANJDhPkcJcvUe42gt X-Received: by 10.28.32.206 with SMTP id g197mr3314468wmg.28.1453286791482; Wed, 20 Jan 2016 02:46:31 -0800 (PST) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id az10sm32640638wjc.28.2016.01.20.02.46.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Jan 2016 02:46:30 -0800 (PST) From: Srinivas Kandagatla To: Ulf Hansson , linux-mmc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Srinivas Kandagatla Subject: [PATCH v1 2/3] mmc: pwrseq_emmc: add to_pwrseq_emmc() macro Date: Wed, 20 Jan 2016 10:46:22 +0000 Message-Id: <1453286782-9704-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453286730-9616-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1453286730-9616-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);