From patchwork Thu Jan 28 10:03:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 8148211 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 E361F9F818 for ; Thu, 28 Jan 2016 10:03:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1699B201FA for ; Thu, 28 Jan 2016 10:03:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C353201F2 for ; Thu, 28 Jan 2016 10:03:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161081AbcA1KDr (ORCPT ); Thu, 28 Jan 2016 05:03:47 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38351 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966410AbcA1KDq (ORCPT ); Thu, 28 Jan 2016 05:03:46 -0500 Received: by mail-wm0-f44.google.com with SMTP id p63so16907182wmp.1 for ; Thu, 28 Jan 2016 02:03:46 -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=dRNwDq5cXBWksiSTJ8WLMHQ2anaGcFW0XaaCQ7VrYI9Lf9azg9eNlF2vUVDeTzXLyT FZY22pHJNDYRT/Xo9UZtf7DaRe/Lv/q5ib0/sON9aosqh0unGO5JidOFkLa9GDjj8VyE XJlc2e9D0GQ4ok9wb1hiMGkVo2yRKfmFQ1DdM= 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=a1Ye7HuE/pBq5JIzta7Km0IM+0H69GMa27rVyv/wK7Q0Z5LTFBMp8tTU/G+bQNfTdi p6Gz1tZzkDNl4erywfI+zyT2fMAdnBOLnHIyrrREEnztfJiWpz/S2H16GBiGpgRgj4l3 lk2iHVgNKLIzRRSYbkNzxphaYQq6DzVul6dKY9hr5taLXk5aWtY6MHThs2vxx4Cc0ejo lUJKG1dieOrX2KrOycMNnSw1d1WNKIUx47iGDf2fnJPvYuPUmg5H5SztPL/IWMZuj+bX eWhhPptIiydVJ9409xwq1QlIeWNMQRkYh2cE/KJ6QTqsTSbqQ1dzqjkyT8WRRIbtSYYY IaoQ== X-Gm-Message-State: AG10YOTo1mwBdpJGWa6m6kXND/GNjOzvIsN9vL87AKgEr+p6ybOliWx+WovfjkEIj9Vr4KpP X-Received: by 10.28.145.204 with SMTP id t195mr2136672wmd.91.1453975425681; Thu, 28 Jan 2016 02:03:45 -0800 (PST) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id s8sm10168663wje.35.2016.01.28.02.03.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 02:03:45 -0800 (PST) From: Srinivas Kandagatla To: Ulf Hansson , linux-mmc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, mfuzzey@parkeon.com, linux-arm-kernel@lists.infradead.org, Srinivas Kandagatla Subject: [PATCH v2 2/3] mmc: pwrseq_emmc: add to_pwrseq_emmc() macro Date: Thu, 28 Jan 2016 10:03:42 +0000 Message-Id: <1453975422-13522-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453975315-13424-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1453975315-13424-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 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);