From patchwork Mon Feb 8 06:28:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 12074081 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A168C433E6 for ; Mon, 8 Feb 2021 06:30:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0BCEF64DC4 for ; Mon, 8 Feb 2021 06:30:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0BCEF64DC4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kjzeOr8RzUIYTJ+gbTUEr62dDKMvG+CDu7wyeSnrA7Q=; b=v40uKyMfaaGbnMvprxLDdZaIq SaGO9hzy/noQ2dVwwDR4llde/AOi3gLDoDKugRgwZx68KJ4tgPDPVwNPc06cJGD//1xEcqly9BQsK ZZ6BdyZ158n6L23CvQM9qNRmQMCa+C6toRAy5b49ofKr6dEffRKI8u+f96YuYbSNDLtt3GsulS7k0 vJ9+VBUkjbnEvD+BNC/b8YBhCDL4Umtbl0cvEvu7Ub1jMB8bPGY41j2jvhQtnlYAu+Z7bT/vZH96d +ZJL3oO0ao8bhsDyI/YGZLHZ1oseeLjaoneCY5AnR5emVVH4pgWHvYEhkyL4rnq8NLU+YjbOydv3l 8fbU+zimg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l902x-0005xT-VW; Mon, 08 Feb 2021 06:29:20 +0000 Received: from new3-smtp.messagingengine.com ([66.111.4.229]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l902l-0005sv-8J for linux-arm-kernel@lists.infradead.org; Mon, 08 Feb 2021 06:29:10 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 771DC580215; Mon, 8 Feb 2021 01:29:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 08 Feb 2021 01:29:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=/JE/fdBn0uHAF /reuWXJArsbuxbUtZ2QdHblap0c0Ec=; b=V4+kTVDehERedfBAbuBzg+5vEeJgL FCmnVx5Xtye+gYA1EPp6jxQz8B0K0lWljaqEkU+SKxeSJSPWLs0+aSotDIsm/UG0 s/Wg/GQqY+7y+PGZ5zpj7XeCcXPvCYAQnID7b9L/1N5aM7RTQdalVSCTvdo0ffsc +iojPpBhmkBWEVCWpmpbxTqdojR+vZrGrQxWRnr1jYscyg8Nulruuriv6NtococK yL4Eoow29OuH+UDqRzxru8AEgoPSVneSL/W3Chzq/qJ2LwyPJPk7gIxw9xfEZtB2 Fl8p0LdrpRVZCKO0CBK22z6U9Wm5W/54Ihmtb0ArTO9yYb6D9uC6/pqbQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=/JE/fdBn0uHAF/reuWXJArsbuxbUtZ2QdHblap0c0Ec=; b=KO/92gda BROjMtWC7Qpzb/AGn1f2gh3UUa9vxOh7lHpQf4rjpwKL8O2FDed6KKQPIiyCJB1p ufRsZrNI7ARqdfBAgcqumCsfp47SFY7O/98k/zdD2pATznfFURpCT9+ohpsJE7cH +Td8wfT/ylih/XrR3xxQvwCTizEgtMD57G3O+mXgLAAj0hE8m6ZIyG4pCJPoLgSf Sf91DBOMrENas8JsbBTbRuSSt3/3i7lcKyax6WLKog83RSO5D2WPtKmpHF+Pc0Ih Uqt8/F+e0+fA0HKt2HcabXrBbv5epBhcpQqrjlOqTyYW202rUebZpSqZ5nLW94fT ikadsH8mG/vBEQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrhedvgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepudfhjeefvdfhgfefheetgffhieeigfefhefgvddvveefgeejheejvdfg jeehueeinecukfhppeejtddrudefhedrudegkedrudehudenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgrnhgu rdhorhhg X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id E77B6108005F; Mon, 8 Feb 2021 01:29:00 -0500 (EST) From: Samuel Holland To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Corentin Labbe Subject: [PATCH] i2c: mv64xxx: Fix check for missing clock Date: Mon, 8 Feb 2021 00:28:54 -0600 Message-Id: <20210208062859.11429-2-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210208062859.11429-1-samuel@sholland.org> References: <20210208062859.11429-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210208_012907_399777_117CA900 X-CRM114-Status: GOOD ( 12.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ondrej Jirman , Samuel Holland , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Dan Carpenter , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In commit e5c02cf54154 ("i2c: mv64xxx: Add runtime PM support"), error pointers to optional clocks were replaced by NULL to simplify the resume callback implementation. However, that commit missed that the IS_ERR check in mv64xxx_of_config should be replaced with a NULL check. As a result, the check always passes, even for an invalid device tree. Fixes: e5c02cf54154 ("i2c: mv64xxx: Add runtime PM support") Reported-by: Dan Carpenter Signed-off-by: Samuel Holland --- drivers/i2c/busses/i2c-mv64xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index b03c344323d1..c590d36b5fd1 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c @@ -813,7 +813,7 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data, * need to know tclk in order to calculate bus clock * factors. */ - if (IS_ERR(drv_data->clk)) { + if (!drv_data->clk) { rc = -ENODEV; goto out; }