From patchwork Thu May 7 13:12:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 11533593 X-Patchwork-Delegate: cw00.choi@samsung.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3661F139A for ; Thu, 7 May 2020 13:08:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1545620936 for ; Thu, 7 May 2020 13:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588856902; bh=iF9jX+7z7ru6HD3PxDGP0QqjiXkokdLrWTYirF4yg5o=; h=Date:From:To:Cc:Subject:List-ID:From; b=uYHMKtT0rhhW1idTsmiri98EkYC+ybT7eVzF76Wuk/pWhEvxCbQUPH6q5Jmogpc/2 li51BYHEXaroiyd7scmEH25Gy/WV7Gw7Z6pXIWv55z86A17l8MLB0UPk/+RNQ6MSE5 MeE6zjn+sNMl2HWp2ySDnWt6VViLmUzZsgfa5Zeo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726093AbgEGNIV (ORCPT ); Thu, 7 May 2020 09:08:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:43762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726350AbgEGNIV (ORCPT ); Thu, 7 May 2020 09:08:21 -0400 Received: from embeddedor (unknown [189.207.59.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BA11F20870; Thu, 7 May 2020 13:08:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588856900; bh=iF9jX+7z7ru6HD3PxDGP0QqjiXkokdLrWTYirF4yg5o=; h=Date:From:To:Cc:Subject:From; b=N5IeqxL+pm8uG+ioRyFmDRt8nvD6Ms5+PVbFa6RD5tUdKaFlFkKlV8vD6QEgLDVkk CM0cW36Z2FJX85xm9lHWd8pgla8pR0nbjoKHVIyHxmlxsQg0UjH7gSA8QBLPcGlS40 amaw0LrBuHVZAyyr2YTyFaT7VE+NwlupSVpFf6Z8= Date: Thu, 7 May 2020 08:12:45 -0500 From: "Gustavo A. R. Silva" To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Leonard Crestez Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] PM / devfreq: imx: Fix inconsistent IS_ERR and PTR_ERR Message-ID: <20200507131245.GA709@embeddedor> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Fix inconsistent IS_ERR and PTR_ERR in imx_bus_init_icc(). The proper pointer to be passed as argument to PTR_ERR() is priv->icc_pdev. This bug was detected with the help of Coccinelle. Fixes: 16c1d2f1b0bd ("PM / devfreq: imx: Register interconnect device") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Dong Aisheng --- drivers/devfreq/imx-bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/devfreq/imx-bus.c b/drivers/devfreq/imx-bus.c index 532e7954032f..4f38455ad742 100644 --- a/drivers/devfreq/imx-bus.c +++ b/drivers/devfreq/imx-bus.c @@ -88,8 +88,8 @@ static int imx_bus_init_icc(struct device *dev) dev, icc_driver_name, -1, NULL, 0); if (IS_ERR(priv->icc_pdev)) { dev_err(dev, "failed to register icc provider %s: %ld\n", - icc_driver_name, PTR_ERR(priv->devfreq)); - return PTR_ERR(priv->devfreq); + icc_driver_name, PTR_ERR(priv->icc_pdev)); + return PTR_ERR(priv->icc_pdev); } return 0;