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: 59978 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2499660lbb; Tue, 19 Jan 2016 02:59:29 -0800 (PST) X-Received: by 10.66.234.8 with SMTP id ua8mr43468808pac.45.1453201169501; Tue, 19 Jan 2016 02:59:29 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf9si6917796pac.163.2016.01.19.02.59.28; Tue, 19 Jan 2016 02:59:29 -0800 (PST) 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; 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; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757422AbcASK7X (ORCPT + 29 others); Tue, 19 Jan 2016 05:59:23 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:33269 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757291AbcASK7O (ORCPT ); Tue, 19 Jan 2016 05:59:14 -0500 Received: by mail-wm0-f41.google.com with SMTP id 123so86237849wmz.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=PymflftAU2OOHIh98oqMyf/jblwcJQA8LZY+kg4LFnguoqczU93wED56O2RvdE0aEW rFNc+zAh1kJU6ie7ruzS1YxX+C0BLaGlozt2Xj6i6J6sQFk0omCkRmW+/St8DHSXvaqv mFwCPb1yI3Qniag9j7Pq/3pYKal4QzlxKI/T4DWkG6BaFv3cYkFkNQ8ZSu2kKOM8xB+i niK+XZkL+wHRZJhWKBTNzs8yH+Mpert1HBhG/2HT8HQhaFdFmLaoMaCcKww5NV+P2LZL J8/ofEn3JtDz+0wFL+PnXJBDbdQkRZemBQWnUnZQl7uU9JVs7N6op6cM15Ua9d7plWiq V78g== X-Gm-Message-State: ALoCoQk3E4LJ+yU5Kpdq0kOScGq0NoqNPz40DilQXMjF9N6XmDiT2JJfAxdgbEGhkPQz8o3CAxyc5K/tVvDjLhNNwQfBXZ9sJA== 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-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(-) -- 1.9.1 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);