From patchwork Sat Jan 11 21:39:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 3470481 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9A91D9F523 for ; Sat, 11 Jan 2014 21:39:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C54762015E for ; Sat, 11 Jan 2014 21:39:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F001520127 for ; Sat, 11 Jan 2014 21:39:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751029AbaAKVjZ (ORCPT ); Sat, 11 Jan 2014 16:39:25 -0500 Received: from mail-ea0-f170.google.com ([209.85.215.170]:41097 "EHLO mail-ea0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751024AbaAKVjY (ORCPT ); Sat, 11 Jan 2014 16:39:24 -0500 Received: by mail-ea0-f170.google.com with SMTP id k10so2646401eaj.29 for ; Sat, 11 Jan 2014 13:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yLLWnA/8WMlM2TSr3rGPOoULZEZ7w5+vOL4l63TsuN4=; b=bfMkd1guJUeHWI276XlBoGH061XImAk1PyLbR0/KZipv8vZfhKaWTZ7R0agn458QFB 3kPjD7JR9dZwMJsIUDGQYCt0LF7ZXvPi0P4c4Goz60Cdlm6qHMeczYYcPH9OJtX350X5 +48/6nJfkqnbL89lXXWjPw7lFE+njMBxxt24GefEmtaEgB0mB5DkhEHwX4zmLov3m5H+ ++2gczlJjMOQ+LxYzsl+cLOKtG0dxgwl7+hurWgvuu5Z0u5KPl8ClAAbG1oTAw+eCY9s ejuHyRTlbo1fKIDTBaiR1gCGcEsEZ8D0p3MhT8vXoLsT0Rcf2ujfdc2Zpl/RK4BMrwnV PRZw== X-Received: by 10.14.126.1 with SMTP id a1mr17998868eei.81.1389476362804; Sat, 11 Jan 2014 13:39:22 -0800 (PST) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id p45sm26014591eeg.1.2014.01.11.13.39.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Jan 2014 13:39:22 -0800 (PST) From: Tomasz Figa To: linux-mmc@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ben Dooks , Chris Ball , Jaehoon Chung , Seungwon Jeon , Marek Szyprowski , Tomasz Figa Subject: [PATCH 3/6] mmc: sdhci-s3c: Use correct condition to check for clock presence Date: Sat, 11 Jan 2014 22:39:03 +0100 Message-Id: <1389476346-20396-4-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1389476346-20396-1-git-send-email-tomasz.figa@gmail.com> References: <1389476346-20396-1-git-send-email-tomasz.figa@gmail.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 IS_ERR() must be used to make sure that not a valid clock was returned by clk_get() and company. Signed-off-by: Tomasz Figa --- drivers/mmc/host/sdhci-s3c.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 9b78391..7fde938 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -147,7 +147,7 @@ static unsigned int sdhci_s3c_consider_clock(struct sdhci_s3c *ourhost, struct clk *clksrc = ourhost->clk_bus[src]; int shift; - if (!clksrc) + if (IS_ERR(clksrc)) return UINT_MAX; /* @@ -567,16 +567,14 @@ static int sdhci_s3c_probe(struct platform_device *pdev) clk_prepare_enable(sc->clk_io); for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) { - struct clk *clk; char name[14]; snprintf(name, 14, "mmc_busclk.%d", ptr); - clk = devm_clk_get(dev, name); - if (IS_ERR(clk)) + sc->clk_bus[ptr] = devm_clk_get(dev, name); + if (IS_ERR(sc->clk_bus[ptr])) continue; clks++; - sc->clk_bus[ptr] = clk; /* * save current clock index to know which clock bus