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: 9578253 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 B5B4060209 for ; Thu, 16 Feb 2017 19:43:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7F052866A for ; Thu, 16 Feb 2017 19:43:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C71728670; Thu, 16 Feb 2017 19:43:52 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 545072866B for ; Thu, 16 Feb 2017 19:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:Subject:From:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wfYZcNpzLP0AcgsS1XSWARdh2ZkV6NYhi4P6LW/Pq7Y=; b=sFLMskneVMKZJP u4UmSA5sMsxZwMCfXaR5zkNsIKgkkNKNfwETXmJ3GGE2u3HcqdAJ6Xc14smsGRyBtIW3D2W7wcQ+c zmbMyX5XNpX8Q8Gu7eveJB1nDTlzp09Gc5zSYuCFNoQuEYBniHZtJCdehoPdenyAOXDq1tQgeXCR+ 9h45h8sgHfn7qVdSspI8l+OiuL4hW/Rw8R7W8ThKydqUb1/aaIQpyCw10j2JzfkJsqJMrpjddyQSu UNBS4tFzI7iLs4wK/D83a/x8IShFI1uuPbzH80UoqzkQkiCNgfJyTisRiesI9Vg/xur/RpV9wHjyH /Teum5MCAPaMkZ1gXMmg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ceRxr-0006rI-Vw; Thu, 16 Feb 2017 19:43:40 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ceRxh-0006fj-Px for linux-amlogic@lists.infradead.org; Thu, 16 Feb 2017 19:43:34 +0000 Received: by mail-wm0-x244.google.com with SMTP id u63so4670670wmu.2 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=iZEq3qs+zBWcr64d3yaXJGLjO2k4fmwhAc5Zu7HW1CW1Hf0StMjyTIosDnyvk3GeQP xonK+tEB9h49pxZVKTwO+iLQbjy1oogKYxeFPK8tk8KeMl2evOgAtdsgqliXxhb4PNv2 aX50Z89EHC7c2Z+ARS7BpVmRglD4nQLYZYzDAkV9bZnrKHP81pJrrfipGi0kwdcSvwWf 3fOvtFHt/okC7N/EU+B+PZiPTVsldIGjW/Xzwygr0FNq3U5XHkAC0SeAV2mTXX6/0pPF +D/1PTgfpEI3/agl/cwnFhHbmpnnvhfW+6iknrJd6/LIAClwQUhVkB6h6BOB5J1L5clj IyWQ== X-Gm-Message-State: AMke39mlwZPhl3SUZW4UQojkNKFSOzZPUgw9q8PEs5QvCNb5/DI1bhgUflyel6Rlc6xkng== 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> 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170216_114330_319923_5E316DBE X-CRM114-Status: UNSURE ( 7.30 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, "linux-mmc@vger.kernel.org" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.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)