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: 3470591 Return-Path: X-Original-To: patchwork-linux-arm@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 580559F2E9 for ; Sat, 11 Jan 2014 21:41:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 946A320127 for ; Sat, 11 Jan 2014 21:41:18 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8FB2C20123 for ; Sat, 11 Jan 2014 21:41:17 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W26I2-0006wI-DT; Sat, 11 Jan 2014 21:40:23 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W26Hq-0001y8-0S; Sat, 11 Jan 2014 21:40:10 +0000 Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W26HQ-0001uz-P3 for linux-arm-kernel@lists.infradead.org; Sat, 11 Jan 2014 21:39:45 +0000 Received: by mail-ea0-f176.google.com with SMTP id h14so2617797eaj.35 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140111_163945_436006_4A35CA65 X-CRM114-Status: GOOD ( 10.74 ) X-Spam-Score: -2.0 (--) Cc: linux-samsung-soc@vger.kernel.org, Seungwon Jeon , Chris Ball , Tomasz Figa , Jaehoon Chung , Ben Dooks , linux-arm-kernel@lists.infradead.org, Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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