From patchwork Thu Feb 16 19:42:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9578239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6FD2D60209 for ; Thu, 16 Feb 2017 19:43:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 638DC2866A for ; Thu, 16 Feb 2017 19:43:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5861F2866D; Thu, 16 Feb 2017 19:43:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12C502866A for ; Thu, 16 Feb 2017 19:43:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933168AbdBPTnL (ORCPT ); Thu, 16 Feb 2017 14:43:11 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34078 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933121AbdBPTnK (ORCPT ); Thu, 16 Feb 2017 14:43:10 -0500 Received: by mail-wm0-f67.google.com with SMTP id c85so4696929wmi.1 for ; Thu, 16 Feb 2017 11:43:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=qZ8inP4hlocFGleJFUTTC1N2VzRZuzJM3YI/IRsppGg=; b=iJRybgYPLcR8U/5GqcUoDqE8HjJx3+1t24l3LK5HP52AkZiNitor8fjMLiCHKXNkqv gKbWg07c6a2mm/2mSvPwUl7HnaefFHrFOPcQNkRPCUWFMuCD0fr7WQdVT2txX5jhGgUd oqdGO/Pr3BZFhWFkpCUKueLk0W+jtmIouJGSwSFNkjatYjX44uNK7jvXQLyMX1W2eBtx pd5RlDhVzUeYgZDP8L2qovUa6UIUEMLVYZcpAvaLijHk9WXyADFWEG4STP5WB34iMfFY 5F8yPm+bEeOVMCFkWId8wOLn3VtwvT+N0FueAsz+T9F09h11aBMt+NZJqRwB8xO8iw5l XzZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=qZ8inP4hlocFGleJFUTTC1N2VzRZuzJM3YI/IRsppGg=; b=FYAeHtVqmYDL4hBBO12kvvIrT2yYzNo44FcrVp/KCgokpPCnUZwFraMx6MXmG9tLRg lTamn/C3pFXe4K95cCxCPsdHPsvLm9F+l3LlAbpArgTd5dlFWfCIB38We9/Im2MUWNlZ lOVWo7Tte36ONb07JxSbUgjp+6Jm1BNEuf4eGwQmlA1LakO1hIrnFE/Fw0pXsvggdnGq AjHFYEvJ++Fh+9Mq/YKUtuRKBB7ZX6j91K/dBg+0+FQCVRhMb9wLCQi3H4jljTNYccbn LolexER182/gpRT7ddcsUZGD0lDAGbcnYnDjfHQr5QWgLA3WsS+JEsqvKzLw+vz9altn obLA== X-Gm-Message-State: AMke39mkzhycXeyX8ooxYtQtkbvGMry4LXSL1qSFXz/wc7+WquoCW103CSfcjsaI2jsY6w== X-Received: by 10.28.31.130 with SMTP id f124mr3710722wmf.130.1487274189269; Thu, 16 Feb 2017 11:43:09 -0800 (PST) Received: from ?IPv6:2003:c6:ebdc:4000:f02a:ffb3:d41d:abac? (p200300C6EBDC4000F02AFFB3D41DABAC.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:f02a:ffb3:d41d:abac]) by smtp.googlemail.com with ESMTPSA id w204sm1398838wmd.17.2017.02.16.11.43.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Feb 2017 11:43:08 -0800 (PST) From: Heiner Kallweit Subject: [PATCH v2 6/9] mmc: meson-gx: remove unneeded meson_mmc_clk_set in meson_mmc_clk_init To: Ulf Hansson , Kevin Hilman References: <7d5263e2-9325-dedb-a5f6-954c4a09e977@gmail.com> Cc: "linux-mmc@vger.kernel.org" , linux-amlogic@lists.infradead.org Message-ID: Date: Thu, 16 Feb 2017 20:42:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <7d5263e2-9325-dedb-a5f6-954c4a09e977@gmail.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This clk_disable_unprepare isn't right here. At first the condition should be "if (ret)" as the disable/unprepare is supposed to be executed if the previous command fails. And if the previous command fails and meson_mmc_clk_init returns an error, then probe jumps to label free_host where we have this disable/unprepare already. Signed-off-by: Heiner Kallweit Acked-by: Kevin Hilman --- v2: - extended commit message --- drivers/mmc/host/meson-gx-mmc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 68e76fa8..850b0152 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -320,11 +320,7 @@ static int meson_mmc_clk_init(struct meson_host *host) /* Get the nearest minimum clock to 400KHz */ host->mmc->f_min = clk_round_rate(host->cfg_div_clk, 400000); - ret = meson_mmc_clk_set(host, host->mmc->f_min); - if (!ret) - clk_disable_unprepare(host->cfg_div_clk); - - return ret; + return meson_mmc_clk_set(host, host->mmc->f_min); } static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)