From patchwork Sun Aug 25 12:36:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13776745 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 AAFC6C5321E for ; Sun, 25 Aug 2024 12:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=1CeKLJiREErcfFDmVmFht0rfeHvolojmCG1SEp0D9eA=; b=DmMjzfihhAlrox4tPYD7amFieA +zrtHDBtp2amLcTGUNuW64oXcJ6Gf5nTLKal/6zLZo1XP4oLzILJyMV7Pqj2a+4/5byP3N+VVFX1P k4/zmWdahq7mUvSBAwxb4qtaSnQ28tuHL3GRHA3WjKxu5AhGVRUNvZC928dxY5TVFldu0LWK8DyVg UIzy7/isps31LK45v0wF/v/cplq3qrgFil5z8OoalhqmtgJ5HBxsNbrKlYdZthwZnMtB0PI891BHF oKGIflNdfVLaoa4PQR48TVSmQFP97n+4ltqtgV7sTgFG8sTrs6Jb2T2CgBDvph8mB62eOLN/SRZ44 LV7aPmDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siCUk-00000004Izi-2X0c; Sun, 25 Aug 2024 12:37:22 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siCTx-00000004Ios-450a for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 12:36:35 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5bf01bdaff0so3680903a12.3 for ; Sun, 25 Aug 2024 05:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1724589391; x=1725194191; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1CeKLJiREErcfFDmVmFht0rfeHvolojmCG1SEp0D9eA=; b=MEiFRbJxmL8fREUjJZ9PJhUJFm2hjfO0tTys5utGP7cKIMU2gni89jgstmPJMqi/QE ECSEjDe5bWRpbsloTCtg3QRzqKqFSyr31iqIHEFGMQgRBhHgfMP2gMVKeBUKVw0qd38O mnH/TliqaErXGUmXGQ5HGJewCyc5Snek8FtkA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724589391; x=1725194191; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1CeKLJiREErcfFDmVmFht0rfeHvolojmCG1SEp0D9eA=; b=YCkuug4++QBUtUhZ5mkrHvc8Kh4RsTi7eVyApTJ51zCjXcPqTFg6udMXim6Fs0KRW8 SazG3XU1UUq8N6ZDvqkVyWx6ipuLioZvCbXnthRKwFJtJeIfq058tQic9As8uSfpO5Tr eTwlb4TduErV/VsPqToIU5dH/NJqvn8wtBqMoU3ownc8/3w5TiolZXGeAu9rKoNLckG6 tWtpzpofoqVFsEvvIynj8PqOPqXUHWMmbWXfm3TNLPFwI7GMvYRGH5t6v2O4xHoY8Tbe NKUcIojwoJ4p+n5a9qKY27rSLCl36IGJg8fgzPiDMDnhmZyFlZo7SGf4qaPEN4wUOwin gVew== X-Forwarded-Encrypted: i=1; AJvYcCUvfVu2d0Ey+6YsWLs/wjm1x9985Yt2FCtiQxtScvjg+XAt8CB2f7rAzhoa5Vdc72PE3IDUELsLBujDGT3ALwnJ@lists.infradead.org X-Gm-Message-State: AOJu0YzdaC1/ZuEvMhRAsS4uLj9EEExrAfQ81S2j5LdAx3AO6AnrgOC5 TxS5btH7Rc4m3WnU9huY/6/91Bnpw1oC1a6tromKT4HCNGEI6bEDdtljORq31tc= X-Google-Smtp-Source: AGHT+IFHSFH/DUCkWWR0GBh4a/QABa5dvYX0l+xr818EafuCdl7Z/HffbouhFE5+OopSoVp6HJHHKA== X-Received: by 2002:a05:6402:d0a:b0:5a2:8bef:c370 with SMTP id 4fb4d7f45d1cf-5c08916403amr5020278a12.15.1724589390746; Sun, 25 Aug 2024 05:36:30 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-25-99-149.retail.telecomitalia.it. [79.25.99.149]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c04a3e89ebsm4350404a12.43.2024.08.25.05.36.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 05:36:30 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Fabio Estevam , Geert Uytterhoeven , Peng Fan , Pengutronix Kernel Team , "Rafael J. Wysocki" , Sascha Hauer , Shawn Guo , Ulf Hansson , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH 1/3] pmdomain: imx93-pd: replace dev_err() with dev_err_probe() Date: Sun, 25 Aug 2024 14:36:14 +0200 Message-ID: <20240825123626.3877812-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_053634_048215_7ED56490 X-CRM114-Status: GOOD ( 11.69 ) 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 This way, the code becomes more compact, and dev_err_probe() is used in every error path of the probe() function. Signed-off-by: Dario Binacchi --- drivers/pmdomain/imx/imx93-pd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pmdomain/imx/imx93-pd.c b/drivers/pmdomain/imx/imx93-pd.c index d750a7dc58d2..afc482ec563f 100644 --- a/drivers/pmdomain/imx/imx93-pd.c +++ b/drivers/pmdomain/imx/imx93-pd.c @@ -126,9 +126,9 @@ static int imx93_pd_probe(struct platform_device *pdev) if (!domain->init_off) { ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks); if (ret) { - dev_err(domain->dev, "failed to enable clocks for domain: %s\n", - domain->genpd.name); - return ret; + return dev_err_probe(domain->dev, ret, + "failed to enable clocks for domain: %s\n", + domain->genpd.name); } } From patchwork Sun Aug 25 12:36:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13776749 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 1E7C3C5320E for ; Sun, 25 Aug 2024 12:38:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zf5APENb9JvqJNcRLDTY5Ylob0hcYN8J/GA4M8ib6BM=; b=AT/r1NdnpWeCgnLxo0Ja9LnaPp c1rM2Ibr2mP0SvIdHi4a0wFb4TdUbtLL8JgrIr5Ffd4MxPIkVnkZo1dSUDeNHG+4skBtIqLvI84vi +REiij8ZXMl1WmRVsmPuvcFiiMccbZPV2MO5EcQF4oAPtmaSVyGM5JWzM2bah0Kx8M0l97UwYPA6r Ciewy0Ma6ebVs89fUK6CcQXjR1obrv6Y0No5qbW++QpaPJc3vSbSWulUJCAuDwV8haDOK+67/dprC GXjJsg+ITadH98v38isrDa6zoD/EB5CLDVpMuQaGuy5zgcICMPjMdOvSewn+R/OsbpBcD7dR5aCID xTA5kX0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siCVd-00000004JLB-30SV; Sun, 25 Aug 2024 12:38:17 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siCTy-00000004Iov-3Bi3 for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 12:36:36 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a86910caf9cso558095266b.1 for ; Sun, 25 Aug 2024 05:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1724589393; x=1725194193; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zf5APENb9JvqJNcRLDTY5Ylob0hcYN8J/GA4M8ib6BM=; b=ddULFgtdk2+jNRGGcE4aFedmp87/vHdhI0toUj6BOrArhcNfqdDU8AhM5+oEeS3t/v Dx53zKAhJ6NFSAbm9l0oiEMFV5BpX5kVuY41kCK32gvhkExsYnFPyUKUke6H7udLVl87 hoQR9Lhr6aGXE8vj+AVTNABtve5YRvlNn/Qjo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724589393; x=1725194193; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zf5APENb9JvqJNcRLDTY5Ylob0hcYN8J/GA4M8ib6BM=; b=I1lLuEBKjf97UTuYZiRkBxkDTs6ajQh9lPuag6/Ey8qG+JfM0BPOLChLIf/k3NxqOc NbAYOlbDnG2joZjrbQbwoJlTutH9gbjJxQwNZXhhz2ZTH9Slh0A6N+OZ2JVZ1zsM9dKL 7k969OKpXsH5nXFpCOweVvcLz3jUz3wHA6CtFZmvECkmqinMsuxP9N1uZeIUkUSlffx3 Dfar5V3Q0JAd2cHXi3PPMAR5GMXXl2xauytfbrVHOiGI62sw6qOyPeRcgjE/YvFL9MuO x7kc+GLwG4O6DxBvO+qgAJKUb+6tO8ZgrGrbctFnIR6gK50YMoIR4d3JZ0GTWr2vYpee u+ZA== X-Forwarded-Encrypted: i=1; AJvYcCVAahJ5S9aaIJGmBoliwwfqNbICR6REhLjXUXVPRS4yVakgj4w1O8+QEoq4g2q2OVzfJFWl38K24lN3iOs17YDe@lists.infradead.org X-Gm-Message-State: AOJu0Yzo+cmYNk0QFy2WquPzlEqsGilBOt8FFEIjWG0zCSurByx1d83V cyuKheym16v26XnjGKDFvtkDGxVzq2qQYKIGqNerQiho0J8W+Ik+k0T1rOaL4gI= X-Google-Smtp-Source: AGHT+IEbIXr1Vpjt4uEgQC8b02IKfOC9sMIl+fcxKuvrrz9/HoMBQxzPbmHf4J/JyeD54FTi1+274w== X-Received: by 2002:a17:907:2d11:b0:a86:a30f:4b00 with SMTP id a640c23a62f3a-a86a30f4d3fmr825679566b.27.1724589392821; Sun, 25 Aug 2024 05:36:32 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-25-99-149.retail.telecomitalia.it. [79.25.99.149]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c04a3e89ebsm4350404a12.43.2024.08.25.05.36.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 05:36:32 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Fabio Estevam , Heiko Stuebner , Jacky Bai , Linus Walleij , Peng Fan , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Ulf Hansson , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH 2/3] pmdomain: imx93-pd: don't unprepare clocks on driver remove Date: Sun, 25 Aug 2024 14:36:15 +0200 Message-ID: <20240825123626.3877812-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240825123626.3877812-1-dario.binacchi@amarulasolutions.com> References: <20240825123626.3877812-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_053634_820732_DD4DF68A X-CRM114-Status: GOOD ( 13.68 ) 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 removed code was added to handle the case where the power domain is already on during the driver's probing. In this use case, the "is_off" parameter is passed as false to pm_genpd_init() to inform it not to call the power_on() callback, as it's unnecessary to perform the hardware power-on procedure since the power domain is already on. Therefore, with the call to clk_bulk_prepare_enable() by probe(), the system is in the same operational state as when "is_off" is passed as true after the power_on() callback execution: probe() -> is_off == true -> clk_bulk_prepare_enable() called by power_on() probe() -> is_off == false -> clk_bulk_prepare_enable() called by probe() Reaching the same logical and operational state, it follows that upon driver removal, there is no need to perform different actions depending on the power domain's on/off state during probing. Signed-off-by: Dario Binacchi --- drivers/pmdomain/imx/imx93-pd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/pmdomain/imx/imx93-pd.c b/drivers/pmdomain/imx/imx93-pd.c index afc482ec563f..24e5bfb336ca 100644 --- a/drivers/pmdomain/imx/imx93-pd.c +++ b/drivers/pmdomain/imx/imx93-pd.c @@ -90,9 +90,6 @@ static void imx93_pd_remove(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; - if (!domain->init_off) - clk_bulk_disable_unprepare(domain->num_clks, domain->clks); - of_genpd_del_provider(np); pm_genpd_remove(&domain->genpd); } From patchwork Sun Aug 25 12:36:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13776750 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 BD04AC5320E for ; Sun, 25 Aug 2024 12:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ShHuxvzlojPRFvc9Ew3ELQFtw3sKey+UcfnKn9H3f6E=; b=xPVVmqvwk0u10rF0C2uvAMuFzs wRGj11/XfL/xWvWw/shi6vRZMs3BgfnVafpV/dibcXOOZ8Qn26TlvRl7rlwjEj26C8lcJhU26+N2f MaxuOu9Qccf2AzVDmhDVLE5dmwzNiZeZ/wbmvLQgZIqDHAHZWp9gPB/S7Wju/9n6araoHpz0ePEyX En2Mf1jcCCloeeCTJ0Ij+r3meX2uPb5NyNR251Ca16VcwfdlnDidizp6RIGKnNG02pAnUypJwY2RM AHNC/k2PYu18Yul4DgUVTmk6eJq59+KpoMzlgR2SwYOIXtGFyN9xoeGMf1h+EfDwgyGjXtgRRdtjx QbJsiDaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siCWR-00000004JbO-2BJO; Sun, 25 Aug 2024 12:39:07 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siCU1-00000004Iph-30rT for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 12:36:39 +0000 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5bed0a2ae0fso4252217a12.1 for ; Sun, 25 Aug 2024 05:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1724589394; x=1725194194; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ShHuxvzlojPRFvc9Ew3ELQFtw3sKey+UcfnKn9H3f6E=; b=dmuce86lBjiEWIpNgORdOJMBbWeQnXdrfOfzOnebULoZhdTtwD2KlGF3pGL7h3NNfx SJUp/wi3Iqp0m9Q/88k/LDUHe3KfB1lvMXxfn7aDPiU+edEvnlYaAUvq69BYn/xMokcO BZa3OnvM2g1vI7x6Kmq5YIK/6hZLvPN/q51rQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724589394; x=1725194194; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ShHuxvzlojPRFvc9Ew3ELQFtw3sKey+UcfnKn9H3f6E=; b=HHQXPfw1X27/bFdhEc0ajUG+gUsnvUNOrkK1k8wMMm0SIB/KBFBMjVXJppIlO/cq9S UkNdHkeZ5ZnXdOfLKFe+yfsapcCEbhlTZ2SPYI1nrX+mlaGJbXZk8Nf+/Gw2HA+ECd12 f/IchPXsd4mm0I4Bxw46RQLUKcoLWUl3JbpBLoloFl+PRwPQvhSaw25OQ0F/6RsNKAVJ R6yQ7hDosNcJQ2mrDkfvGVSi2dx/a2yxtQfjnWaH8etYNZ0bGmriBJPJngbn+zmIuYSE CpuD5c+pBTuijN5tS712EPT9lqrIhnAL4Qmw+Ab/n3/fZwjvusoxbgiH2lc5EL4srxMr l2rA== X-Forwarded-Encrypted: i=1; AJvYcCVMn/iYyxmcD3UHwH485BvgfJazdVWd4GyrxBlwmS8dOAQYrY4/Wii9sk5uGAQBzZPqQfR2uxoOrXWuZPTKdGWH@lists.infradead.org X-Gm-Message-State: AOJu0Yw3L3/OwaC/n7yyiOqw+d4//Jrtn9b+Za7XGDgczxnvkYrfQhGI /5uTS28dahEy5lFBs1kby7PkYEOFGOra+cMkJBvifoHiRt99adej+DrGUmDomdw= X-Google-Smtp-Source: AGHT+IFk/IJXn74tutfj7Fq68cQQXgnAphQ1qnaQoukGQnyX10Zxsca/cXbss1Duy4H4M6p0Tyfk6g== X-Received: by 2002:a05:6402:d06:b0:5bf:2577:32b8 with SMTP id 4fb4d7f45d1cf-5c089163827mr4756973a12.9.1724589394509; Sun, 25 Aug 2024 05:36:34 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-25-99-149.retail.telecomitalia.it. [79.25.99.149]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c04a3e89ebsm4350404a12.43.2024.08.25.05.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 05:36:34 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Arnd Bergmann , Fabio Estevam , Geert Uytterhoeven , Jacky Bai , Peng Fan , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Ulf Hansson , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH 3/3] pmdomain: imx93-pd: drop the context variable "init_off" Date: Sun, 25 Aug 2024 14:36:16 +0200 Message-ID: <20240825123626.3877812-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240825123626.3877812-1-dario.binacchi@amarulasolutions.com> References: <20240825123626.3877812-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_053637_777883_64F71273 X-CRM114-Status: GOOD ( 17.35 ) 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 This variable is only used within the probe() function, so let's remove it from the context and define it locally within the same function. Signed-off-by: Dario Binacchi --- drivers/pmdomain/imx/imx93-pd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pmdomain/imx/imx93-pd.c b/drivers/pmdomain/imx/imx93-pd.c index 24e5bfb336ca..cc848f63219f 100644 --- a/drivers/pmdomain/imx/imx93-pd.c +++ b/drivers/pmdomain/imx/imx93-pd.c @@ -28,7 +28,6 @@ struct imx93_power_domain { void __iomem *addr; struct clk_bulk_data *clks; int num_clks; - bool init_off; }; #define to_imx93_pd(_genpd) container_of(_genpd, struct imx93_power_domain, genpd) @@ -99,6 +98,7 @@ static int imx93_pd_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; struct imx93_power_domain *domain; + bool init_off; int ret; domain = devm_kzalloc(dev, sizeof(*domain), GFP_KERNEL); @@ -118,9 +118,9 @@ static int imx93_pd_probe(struct platform_device *pdev) domain->genpd.power_on = imx93_pd_on; domain->dev = dev; - domain->init_off = readl(domain->addr + MIX_FUNC_STAT_OFF) & FUNC_STAT_ISO_STAT_MASK; + init_off = readl(domain->addr + MIX_FUNC_STAT_OFF) & FUNC_STAT_ISO_STAT_MASK; /* Just to sync the status of hardware */ - if (!domain->init_off) { + if (!init_off) { ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks); if (ret) { return dev_err_probe(domain->dev, ret, @@ -129,7 +129,7 @@ static int imx93_pd_probe(struct platform_device *pdev) } } - ret = pm_genpd_init(&domain->genpd, NULL, domain->init_off); + ret = pm_genpd_init(&domain->genpd, NULL, init_off); if (ret) goto err_clk_unprepare; @@ -145,7 +145,7 @@ static int imx93_pd_probe(struct platform_device *pdev) pm_genpd_remove(&domain->genpd); err_clk_unprepare: - if (!domain->init_off) + if (!init_off) clk_bulk_disable_unprepare(domain->num_clks, domain->clks); return ret;