From patchwork Tue Jan 19 10:59:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 8060601 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 49B249F8AA for ; Tue, 19 Jan 2016 10:59:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F7F82013D for ; Tue, 19 Jan 2016 10:59:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8BE18200F2 for ; Tue, 19 Jan 2016 10:59:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751880AbcASK7V (ORCPT ); Tue, 19 Jan 2016 05:59:21 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:33268 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751871AbcASK7O (ORCPT ); Tue, 19 Jan 2016 05:59:14 -0500 Received: by mail-wm0-f54.google.com with SMTP id 123so86237846wmz.0 for ; Tue, 19 Jan 2016 02:59:13 -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=j6XZQROCzS4Xvtvp9Nqx2fpfGyGLjZWsJIO5G0sypf4=; b=MJA8YLSq90CmS4hq9npFKl66Wqz3ttXnTsX8D5wnkXiuakWvHYJFp/0BT28eYFYvpe CgDWAQoV3W6zyr1pswgg/9DmD/fBK3poIXItMfm1WNeBFPf6RB+r2ut/Za2HHl/G1TXZ ebKU0rJB/kvrcSp4pXiIWcPQfeEUx0AE9jMyk= 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=j6XZQROCzS4Xvtvp9Nqx2fpfGyGLjZWsJIO5G0sypf4=; b=kG7JxBWGEDb9CuRFikac8Dc+cb663aifsudDKwcSLazFYD6w4BIAdACjIBstQAEVbI EzJFKg6QpN9Xly6xy+B4p5x+vguvvagLOUR6F03+OvMy0QVeMHVBL6ufnWWHjinRTmUn FfSmpYy/M028as4z25wnqYc7SoaUz6w/oqf9cwhW0J7QjdvG5G94z4028k6zrivNV8vR kU8NqXzoefgGDiHVzkrSQFWowp6GZv3BNxxqDvlSkBrfKe68bGYNbxPk0/1yII+6M5HS 1phru8sWUoew0O8+v7/trhi0/vja7csL/kAvcQ+UikxdYjkZAimEpqpb+xh1kfMPQgqZ oDeA== X-Gm-Message-State: ALoCoQnvf3NN05CHJ603FSYaKl17Bemwq9LLiabCkh3XUTxF1izR5ntTU+7CGf1KC9DOo9msdu/FNL6pqLrx/2SwphEv+FayFA== X-Received: by 10.194.113.227 with SMTP id jb3mr29939767wjb.49.1453201152567; Tue, 19 Jan 2016 02:59:12 -0800 (PST) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id i63sm19870264wmf.24.2016.01.19.02.59.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jan 2016 02:59:12 -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: [RFC PATCH 2/3] mmc: pwrseq_emmc: add to_pwrseq_emmc() macro Date: Tue, 19 Jan 2016 10:59:08 +0000 Message-Id: <1453201148-2547-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453201052-2347-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1453201052-2347-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 X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 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(-) diff --git a/drivers/mmc/core/pwrseq_emmc.c b/drivers/mmc/core/pwrseq_emmc.c index ad4f94e..7978fb7 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);