From patchwork Mon Oct 2 07:01:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13405591 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5089E7849A for ; Mon, 2 Oct 2023 07:02:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=vqDXsX/KVx5hqPFXD7O6HMgUJ5p5C1v02h9QFc31aJU=; b=3yeml2iEMmOMjR PLKbt7tkfqc62qyT/uF8OZBodJ636UembSyyBkYY75KAMIpV8ED+6cCXP5I7yazkX9PALknAT3yeX HjQtzyfMgj7yHxofNtANd9WWErdTLibaH1pKZxXEnxzdOM/Qs7q+5tDSoK8YT7KfliIkeFQtjuuQd bWhD9gHEnhFcP9F9wCMAlLIXAERDL1XYbheWt9FQ/1Zt67jZQIA3nbSxLF7rDAw3g28gDBo9vRl/m 1dXbeZgdGtHX4BFly/ewRUnobxZNeXZrCbdW3kVDmZht9nGeJ6TbkfprEHIXoIWvlZbm5X956cHT+ dlyOXKhJrXHUj72JiRzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qnCwM-00C3gJ-0a; Mon, 02 Oct 2023 07:02:02 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qnCwI-00C3f6-28 for linux-arm-kernel@lists.infradead.org; Mon, 02 Oct 2023 07:02:00 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-40652e5718cso38804435e9.3 for ; Mon, 02 Oct 2023 00:01:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696230116; x=1696834916; darn=lists.infradead.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=To5Z1ek1ng/bcrw4gcWQYfPUL1tJalZo399lDaaqlbk=; b=F89VZWtrATQrLsvjkcIa3kLbXkbzz6tbezOW9oKapySlT8lIVSyfgsGeF03NrLVRRr nIQ5SYI9ZxIYL167lDxSr2H+fXDRZSoI8WgpObDFy0NQB+Nbd4nqIHwyt5NQs8orlqqY 7OIfQCcTn/T8hXj0TaDn7TX1BwEFW9J3DcDC0LqDHfpiFRYC9wEjM9bvqU4hDZcMLW6i Z5jZvSSVLPtp6RnIM5+SvLGyj5t88yGrTsTZgZYlixNduBKuZV3Jfcyz+Dzg5JTfLfn2 9YVI2Go23eIO1VqN5roP0OgN9AbtlOfgmExhZKwPPLTK3FDY0kh0XPa428r8nfZyW2tF K3eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696230116; x=1696834916; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=To5Z1ek1ng/bcrw4gcWQYfPUL1tJalZo399lDaaqlbk=; b=HYmWfhlwWqW8U/Cx05VmFo7GSGCXbpIoy+79x4ABkHJuADF1Y0UhXHQzMZnpOBoKpN qhdcb37NQFc+fUtImp43fw5XBe8U1bPOHQzXfha5ul/Zxpd9t8yC/zFkjI68Qog+NdEI WpdVAgMKT4dp9W9E0IFYozEMX59EGRfOdIZjdfsTLBAVHQaqWUlgTgn9Rid9T+7D8p8q aTyiM+fNhfJFYAie56KVbgeznIlTEAA8WykLbvms7nGGUEUTWMs5ZFe7o8n+jUtFkh1a 6yzP2NrZYqhYMPFT1nX9nnVkHIWflgyz7K7Mz43xaWjqcQrCGSDDdvrbbnAkF8y+sqH2 0tTA== X-Gm-Message-State: AOJu0YwkP0lcaD6vCBLIAdYkdUx9B7MytYpX0B9GcV6zmz4SuDSLwNp7 vslKV0dhwZigvReYaYBxHGJh2g== X-Google-Smtp-Source: AGHT+IFUaESPnID8Bx8Iq2U2O1ScDfATW117K0k6Diplm+aeOUbawH1TDpLk+t5XmonRkAxYLh2RTw== X-Received: by 2002:a7b:ce8b:0:b0:402:98cd:a3e9 with SMTP id q11-20020a7bce8b000000b0040298cda3e9mr9220533wmj.32.1696230115893; Mon, 02 Oct 2023 00:01:55 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id v3-20020a05600c214300b004063ea92492sm6595641wml.22.2023.10.02.00.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 00:01:55 -0700 (PDT) Date: Mon, 2 Oct 2023 10:01:51 +0300 From: Dan Carpenter To: Shengjiu Wang Cc: Abel Vesa , Peng Fan , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/2] clk: imx: imx8: Fix an IS_ERR() vs NULL check in clk_imx_acm_attach_pm_domains() Message-ID: <44bacaba-848b-4e62-908c-16538330d4dd@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231002_000158_714582_94889470 X-CRM114-Status: GOOD ( 13.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The device_link_add() function returns NULL on error. It doesn't return error pointers. Fix the check accordingly. Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver") Signed-off-by: Dan Carpenter Reviewed-by: Peng Fan Reviewed-by: Abel Vesa --- drivers/clk/imx/clk-imx8-acm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c index 1e82f72b75c6..83019b986622 100644 --- a/drivers/clk/imx/clk-imx8-acm.c +++ b/drivers/clk/imx/clk-imx8-acm.c @@ -287,9 +287,9 @@ static int clk_imx_acm_attach_pm_domains(struct device *dev, DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE); - if (IS_ERR(dev_pm->pd_dev_link[i])) { + if (!dev_pm->pd_dev_link[i]) { dev_pm_domain_detach(dev_pm->pd_dev[i], false); - ret = PTR_ERR(dev_pm->pd_dev_link[i]); + ret = -EINVAL; goto detach_pm; } }