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; } } From patchwork Mon Oct 2 07:03:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13405592 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 35D2EE784AF for ; Mon, 2 Oct 2023 07:03:45 +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:In-Reply-To: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:References: List-Owner; bh=Jd/Itjo9wLnt9avb9JNh4Z4l1UnUAZ+JSyMVESpSfRo=; b=so7UQM18UDXxWR XUcOOeHvD1ChapByFG1kR0LeVTm7XgfJU2IBTcY0KqTooZF1pJqw37iI4by4aDXeNAa+yrY27Loso B1zcPOCwlXqTQylHXEPxDQbVrfUG7UWgpz6eHOu+Kcmens0nobpdqf25SeegWtrgO87xllZaWhxOs szeEH0MIaWIpSd0Ka7jBVDg8tSceFbfgubbLynyb+TdD8BnnZWRCNGZTUN75Wg7L4UGB/1x5WdFIp mBMYYfRtQYkjOzzy7WAKwoItjNaD8a21ExXrN2KOOZTHcBftzY/MkTnkAWj89DIwYZJJJOegilsRB otN+mFGAhnT4TfhZHh3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qnCxW-00C3v9-0c; Mon, 02 Oct 2023 07:03:14 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qnCxT-00C3uS-1Q for linux-arm-kernel@lists.infradead.org; Mon, 02 Oct 2023 07:03:12 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40652e5718cso38813465e9.3 for ; Mon, 02 Oct 2023 00:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696230189; x=1696834989; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=8xam3PZVeEtEQPfmOLn7BWSBTDM+HLGUGDwJNItVyho=; b=eATz1sAArPWhr3OQrL8nRl4McYKPLoZzC71G/Xif74oYSbVwyLDj0bUBh9z0Ym932Z r85xxIcRMGPvGwfeXYSWBryAN1T6c+Mpf2lJjc1zP1WIXtrtD5WPOCY6ooc7pYUGsDNW c5wkhEXiEFQxQxNPlqmiyrYi5pU+WqupupX/9PCjSVU7t28gQBjNaTzRE/5/00kNWUCo /WN/t0vt4MG7gjhsWdPZtjKo7hfpF0eHKBSm7BOc/gZBX3SzWLi869nAKr1P4Nyj1j7e nXLgNjKLaUltXAffdWzumeYHJgq52ilbBdjP/4Ep8JlLMnukDrokyJQEF/05eXFuGGPn 1WPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696230189; x=1696834989; h=in-reply-to: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=8xam3PZVeEtEQPfmOLn7BWSBTDM+HLGUGDwJNItVyho=; b=b7n6cOhGiMpl13xGnZZEQ9kZOUUtsbVmyyWsUJuhCi6ZtHWB8ZSH6stEqTrZO44hn4 sNr4J9ADlhh4t8k61+y8QW3uQ0ga4IvO8F740hXO9m5L6ITgYn0UYbzHIWq58crVFXnn qXBcMdAwucDq/o+f5oiCTb10ja2HX/jGxcgQqzwv+Fmp3SO5lISpHEw93yjb5qM5Pb8G opBiOPZqFHLS0YkfLXrjM4I3xnpjPDKK/iZJOsiU7FgacgqQCpdIVsTKfxNgdsCD2CKO 4x5EX5uLlPM9fVyseHmM+m+n45qy4n1PBJAwUs3YbpOO04/s7UHHL/XtoziUlx7ovP49 KzMw== X-Gm-Message-State: AOJu0YyDYNzfFRI1VjfQP0hc2PV9ERcGKETTJa1JKeN/wGjzpo3Tzpbf A0EY/V3RUWMAof/fIDQvZ0soNA== X-Google-Smtp-Source: AGHT+IHe/uakDLQktyMmNkscQDeTYcwcQmvAInoA17Wx3S0bsUubjmPjLLx5Je6hz+4d9qyLvWv7uA== X-Received: by 2002:a7b:cbc8:0:b0:3ff:ca80:eda3 with SMTP id n8-20020a7bcbc8000000b003ffca80eda3mr8715560wmi.10.1696230189198; Mon, 02 Oct 2023 00:03:09 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id d4-20020a05600c34c400b003feea62440bsm6649360wmq.43.2023.10.02.00.03.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 00:03:08 -0700 (PDT) Date: Mon, 2 Oct 2023 10:03:05 +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 2/2] clk: imx: imx8: Fix error code in probe Message-ID: <06727485-a142-4ebb-b764-49841537d44b@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <44bacaba-848b-4e62-908c-16538330d4dd@moroto.mountain> 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_000311_482575_F610EDCE X-CRM114-Status: GOOD ( 12.01 ) 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 Preserve the error code from devm_clk_hw_register_mux_parent_data_table() instead of returning success. Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver") Signed-off-by: Dan Carpenter Reviewed-by: Peng Fan --- drivers/clk/imx/clk-imx8-acm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/imx/clk-imx8-acm.c b/drivers/clk/imx/clk-imx8-acm.c index 83019b986622..550ceac45ff2 100644 --- a/drivers/clk/imx/clk-imx8-acm.c +++ b/drivers/clk/imx/clk-imx8-acm.c @@ -372,6 +372,7 @@ static int imx8_acm_clk_probe(struct platform_device *pdev) 0, NULL, NULL); if (IS_ERR(hws[sels[i].clkid])) { pm_runtime_disable(&pdev->dev); + ret = PTR_ERR(hws[sels[i].clkid]); goto err_clk_register; } }