From patchwork Sun Aug 25 14:34:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13776799 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 89786C5320E for ; Sun, 25 Aug 2024 14:36:21 +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=KJCtcmIB3UdIrkYLcVzOIpEPiO2wmd+dCBPvqHnV2K4=; b=DKrWZNauJj0YCsd14Yy9PmLaJm kc9BHkoBVxE1VAibtbOU0Q7H75cmcabbjNxCCAHIMfoWm42QnZzV0uAW7Y9i684bU0Xsdjo4dOplQ DtkOnNKzSgWn3aSUOP0uYf4dq1WhK2IWmf0bgu2DL3clcp165nuf0ya2I7cFdxvcW7bzCNspabnXM dhBzEmPxKLxOKtcMS0sg61omT4PKQ729fJ2FQUk1on0yqMt84yFOJPrUxSbSoX2NmWW2qhDA1sipy Kk/SuTRh+5EYQXIIeKJsH91ozRatkX5sCWGHGXnXmhH5fa4wryN0ePAkKjeYqUJRkcW3UnhyWTv3p UO+aj0gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siELi-00000004Vdm-2y6u; Sun, 25 Aug 2024 14:36:10 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siEKE-00000004VHi-443I for linux-arm-kernel@bombadil.infradead.org; Sun, 25 Aug 2024 14:34:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=KJCtcmIB3UdIrkYLcVzOIpEPiO2wmd+dCBPvqHnV2K4=; b=B41CZItN8fbFQq3U8PMRypJ7Bv DQc93sJm1KXFB4FEkF/OVF2nJaEsyyLTtYhJlebIYdA2oUjggxXIC261qXViZ3Hzdfbzh9kosEdMQ E/P0IEJrfXdWG1wSwGZJoG2yyEuiERUip8lBu/qT9Nk+5066FdEkqosvAy861WnBfp/k83yhFuPxA Hrt2tDG6p0HV4+Uf5xuwxPr4i+1Um722495qd15hPWd7zna2pJUw2u8NHtouoHZDJyGve+zrFmX7i oqxuh9730lhwdvbDzkKY80i6qzS+3RV/9VzBC9kvTdebNx3bYroS+sdSImGungwGB5PfV5PFt4PDF 3qgPAo2g==; Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siEKB-0000000ASHe-21Xv for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 14:34:37 +0000 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a868b739cd9so421908466b.2 for ; Sun, 25 Aug 2024 07:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1724596471; x=1725201271; 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=KJCtcmIB3UdIrkYLcVzOIpEPiO2wmd+dCBPvqHnV2K4=; b=OOUbAiuEx0kAWG2Nzy6T6G4f040/lKfo792F9YMhMqF7hp9xbgLgWIXWCwvfQO1LZm xovUKHgpLDJHEjiPVJu4ADJZ5+pOrZlwDc/vai3Nl29waPB/Z6UN+au/AUla9nQjk9fs PI87R5syrc2DK7W6ITAMrrX2B3uejTy1TqyzQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724596471; x=1725201271; 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=KJCtcmIB3UdIrkYLcVzOIpEPiO2wmd+dCBPvqHnV2K4=; b=lsmSyGK87yD4yt7ym8w1QkhmtC1TB1/my2BIVBwdw+L0QH5F0a5v6Q0UQJnYRu5LU0 OwdkAl2K1/sE47PYb6af9qh8aBiss6XCvYnKHAruJrNVfr3zQGvlKqlTSKNXcu117d8I ug4TbBaUIGghTaCdVPbHCh8HrwWFs7osGgqNcLBcEtz85i8YldMyzgQuQ8E+9QOqCeGB l5WoINEGq78pc+wooQkAKaqHViuJRnciEwtVpJNY8bq0O5YG3P4tNe0yjqPrcf3EwBZ4 9OagtkedzzR6Eemc9x8jS0aHoUuA49V5pRv9nWDI5VLo8/DV2j3OdwURKnc3/Wchw8qp 5qrg== X-Forwarded-Encrypted: i=1; AJvYcCV03bbxcxzo55uuKwDcECDmBN/7RMhz6pbQsMQmlMjcjKWcMMVd0aaWnDekSJYXOZydtmx0LJ5DIVuQhPcmHupT@lists.infradead.org X-Gm-Message-State: AOJu0Yyb+BezGBqeyIyaAxN1uYl9FOTBxTI/IBcgxOkx/8RPqybAH5rW MyBU1TlTHp5nPgzoqCOwKUwlnjhbWSww99ulF3M8S5rYC7e7ToLgZWo27/3SUK4= X-Google-Smtp-Source: AGHT+IFrPkCDWSQxHr3mcynt8lDSRSWlq9K1FdNFRP5DdDzP7xtG+zdnJc3gqlxqDwJcYjVr7uYgTg== X-Received: by 2002:a17:907:7f12:b0:a86:8524:2558 with SMTP id a640c23a62f3a-a86a518a3a6mr468976166b.12.1724596471075; Sun, 25 Aug 2024 07:34:31 -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 a640c23a62f3a-a868f4862b6sm550625566b.170.2024.08.25.07.34.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 07:34:30 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Arnd Bergmann , Fabio Estevam , 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 v2 1/3] pmdomain: imx93-pd: replace dev_err() with dev_err_probe() Date: Sun, 25 Aug 2024 16:34:00 +0200 Message-ID: <20240825143428.556439-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_153435_766838_6ACB0DE6 X-CRM114-Status: GOOD ( 14.06 ) 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 Acked-by: Uwe Kleine-König --- Changes in v2: - Drop the extra { } to be even more compact. drivers/pmdomain/imx/imx93-pd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/pmdomain/imx/imx93-pd.c b/drivers/pmdomain/imx/imx93-pd.c index d750a7dc58d2..44daecbe5cc3 100644 --- a/drivers/pmdomain/imx/imx93-pd.c +++ b/drivers/pmdomain/imx/imx93-pd.c @@ -125,11 +125,10 @@ static int imx93_pd_probe(struct platform_device *pdev) /* Just to sync the status of hardware */ 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; - } + if (ret) + return dev_err_probe(domain->dev, ret, + "failed to enable clocks for domain: %s\n", + domain->genpd.name); } ret = pm_genpd_init(&domain->genpd, NULL, domain->init_off); From patchwork Sun Aug 25 14:34:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13776798 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 09684C5320E for ; Sun, 25 Aug 2024 14:35:36 +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=b/+WxYlkSCaxJVD+lANibTyIufP0s0obescAo/C5LRY=; b=cVnfgyRVUIjGNPvjG2NCwInGdv bT7bqjdb9HUybfSNO1SxY+3167JWRa04fO2PtahTGQSKAbSOpXkvIRJnS1CmxPyAGOdsGweqqPw7D v89c7+omFTshbIYhE4/UfoitZF/x//tSfUnvAICGyzyMGxzNbuVH4dT2Mn1hzmE1etPWtg7Qyz4Y5 RnMQ57LS6bibmqP0GP99qRN+D2AcWzbN1RNC7odC0JK7jrhO/rCk9wPkdGCjIS/oZLwyvE/NZxR+T FxcUe1y+olsBmtXMycALZnsRoWWWJJ9EWc7f2bxfhb9bKz796U5nnLiVP3/dfcZCb5HxGCcZC/P42 dyg7PKAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siEKy-00000004VU6-426x; Sun, 25 Aug 2024 14:35:24 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siEKE-00000004VHh-442p for linux-arm-kernel@bombadil.infradead.org; Sun, 25 Aug 2024 14:34:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=b/+WxYlkSCaxJVD+lANibTyIufP0s0obescAo/C5LRY=; b=cWk+gA9THylwMrOTMf1IyRSymb BHh/05oC1f/t1NoaEWIBLoJGD3LJcpVz9Y7UUKRug8IGMYy3NwH3t3KWR4ML9v7p39SJkdp54SjE1 ZYWxaoyZictg+UOSJMIeMBJc2k0vq/Vpl/khAy/U7E2BLeHvcmX9I8HoNN/NztBarALrD3H7FS+Cx /zAz/6NQQ5KooSdrQtzmBT6oOwEG+HGUqMPsYP7zbPrAxZr1e8HMGUDBtXsWqOImNIuIsb3lHdTsX k5zTHMw2XLEFV0ijpxeDctLB/c8XV1lsTBXyUKX5Zcvd6n408q0ulT7dIm6deYCX/HzmD58Eo4JfD KewKZQug==; Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siEKB-0000000ASHf-2bJq for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 14:34:37 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a8677ae5a35so354390566b.0 for ; Sun, 25 Aug 2024 07:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1724596473; x=1725201273; 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=b/+WxYlkSCaxJVD+lANibTyIufP0s0obescAo/C5LRY=; b=qRGFWVASTM/+IKJrbNKwCecwCi4vB12ToZRpdBjyjGERWm68XiysGjRGsvGaw15zuc vf0TzIMlgPDGZs2q0EQsVSFBg5ZIJhbF+F2Q02GQipUG3GOMtozMbxFbpCn/ks8ascxu 6xzG1njOMkg3FkBH0ItloUdJ7kFTM9kjsJSsw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724596473; x=1725201273; 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=b/+WxYlkSCaxJVD+lANibTyIufP0s0obescAo/C5LRY=; b=TH3yw1nfTG4TPB9M+e7gNvjqUI5TkFAtu0qZ8U6HBQA3qDRICy+aEPN9VW2bGyy0Qz yOto5KayFxR3obYhLUbEu0Hnh0E/E5Swy1DouB5MFnzaeocCupQdZ0dFN633m9wxtzQQ SwX3yr/s9u9yrjS14kgEYr3VbqOhfqcp/m/tBrEnkGwlgCj4WaLFmGDniRLgJlNAG/5H khpgTeJ7XjmQAMbP8OREAdaupw/fo/GXPdVZeZrUfctNShIsT8REjfmwqKYTdBCyJ00A p1IQcRedRZa7TebJpo1j4+T4F/8fi+SEF098aXG7h3zoRFskFHhg5WICn6I8gRb9rxHd kHlg== X-Forwarded-Encrypted: i=1; AJvYcCUoI17gDC+AHGD5rSmcxyApP8xDsFVqn77Czdh8s5Hb38sIAbPfACK6QIEfbOasH3m0RTUKtmHV1FfWY7JZkP8a@lists.infradead.org X-Gm-Message-State: AOJu0Ywyp6dKbvBJpUud/mlnnG7Sd1M6DY3lG42R+VUg56fg9D124lG2 uwc7GNID0M3/9lPJfCRlVOFfOSz0x8HSP8gSzjOfoYZG++BLiVqFq9FIi/8y9RQ= X-Google-Smtp-Source: AGHT+IFIxJEDmnRdmJ2yfEJLKXiwKOFoIxfU32uGKJOfRx3/E1xOLH6e41n99MLu4zc4j3as810TWA== X-Received: by 2002:a17:907:9626:b0:a86:899d:6459 with SMTP id a640c23a62f3a-a86a53017a9mr610711266b.38.1724596472420; Sun, 25 Aug 2024 07:34: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 a640c23a62f3a-a868f4862b6sm550625566b.170.2024.08.25.07.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 07:34:32 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Fabio Estevam , Heiko Stuebner , 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 v2 2/3] pmdomain: imx93-pd: don't unprepare clocks on driver remove Date: Sun, 25 Aug 2024 16:34:01 +0200 Message-ID: <20240825143428.556439-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240825143428.556439-1-dario.binacchi@amarulasolutions.com> References: <20240825143428.556439-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_153435_925112_496944DE X-CRM114-Status: GOOD ( 13.32 ) 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 --- (no changes since v1) 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 44daecbe5cc3..fb53a8e359bc 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 14:34:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13776800 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 41BCBC5321E for ; Sun, 25 Aug 2024 14:37:04 +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=pUP1tr1Biob0qdgqQZiV/8XgCxeEAXErXHQFm+tqx4M=; b=AUiBsryZmVbo+xc8ZwLGttJBpe RjAW6voVV+AwKRslM0krpQMpq3hzYkveTN1DdbSSo5fm6hHU1I2IJXTbs9IxO7mRpOGPKqSV2C1b2 v/Pae8/J77KEa/pCWPWNBfkPinwh9+VkEvTJTOGeNv0Vh2q8i/F/YtWbAVZJaUs7xrlnTK1zej30V hPNy7999MBlEe+Ee06U63ngv+dcvjhkGYvl813u7ihmjMQQLho5ioFGqbBk2sbpURbqFTj8StSkB7 YK8ExJEBIsaH5zlzgCm4p/KrSV931KTGesYb7Qp0kFXxkBeHC+X7AKzI/JJdkF29Gaiiv97pv6bgT S52HDSEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siEMR-00000004Vjl-1OE1; Sun, 25 Aug 2024 14:36:55 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siEKG-00000004VIA-1VbW for linux-arm-kernel@bombadil.infradead.org; Sun, 25 Aug 2024 14:34:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=pUP1tr1Biob0qdgqQZiV/8XgCxeEAXErXHQFm+tqx4M=; b=XsVG5ZbqftISNoIewBNHYcVlto KhDa8PrMk0EkN072O3RwPXuHVX+z+9DKVL/u8fSZ9YWL8/RUez0C0PjnBABiuylzuTlhswJNj440H qlqGP324+IM3rbSfst/Z1dAzTod+5gOeucPP4CotLJRUKxVkEvjg412Ox+Fsu3Kdy99QUZH5tLeDf EJnAQ6HmrpJUWklU3aJM6dvHUp/dK/zETSjJPNYRcUgVOPcpEcmHHVns/VgO5k5ZpbeSfEm+GqPKH idnUMeYZRZrB1wzsyvh1T1dE4evXl61RjnMy1fIAHCZH7rjRsFfbAV582ROiA5GGL5QjFUSccpTsN WtIXek3w==; Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siEKC-0000000ASHg-0qD1 for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 14:34:39 +0000 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5bed72ff2f2so4310897a12.2 for ; Sun, 25 Aug 2024 07:34:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1724596474; x=1725201274; 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=pUP1tr1Biob0qdgqQZiV/8XgCxeEAXErXHQFm+tqx4M=; b=C8i+dskF1ctO1q1dL6d2qbmQBtIcn9TZkiIglE3vmtUqfTMod74/b5udYjFD8w8by5 Y7UGyZkEpNbylKiIMh18FD5X48QZGEUxrCJhd2mx2qySc6Mmtaa6jQnRvSf1WrI3G2jf /tCQFL6v+2ix9+CW/xK4c5Iw3HFjVdwBRfrlk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724596474; x=1725201274; 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=pUP1tr1Biob0qdgqQZiV/8XgCxeEAXErXHQFm+tqx4M=; b=Txn21YR+vtoC/lT1GNv3WxOvcma9YBWDsfY6DebF3IEHRKS7EMj7cmKKhw6rA7NuYl MNfGNqv+hBz/sZIk2kC6O2AggxCNMUzVkvTr7lG61Vrd8OyvClLCSXXDOkk6SsipSx8W lvA1SYRok5KoKzkr8sDI6aiYD/KK4SnicAn9hU0k3ubuArO0bnOJfF92uLBD1DVtz2nW 1wW18yonW9v0jPlAF0Mj++p8ybfMpD56/Gr50Vu5t+Kp9jVOK9zcn1F7/trPJZtm1GAg 27FVRUquulo/6cFsugz0pDUnLW19M3vC1p4KOLqhENEqt54UJiFxMsTRrVS4I8yw+pBP M8Dg== X-Forwarded-Encrypted: i=1; AJvYcCWNdWpeH5ObVfSlEn2APjhGNcareyQYbuffzoM+r1JJppALoLtqp4t4Z5qGfkaTyUCFzCygwMfxE+3DtuQdHRWg@lists.infradead.org X-Gm-Message-State: AOJu0Yzq5Wfq36hvUAVvm0vFtThLPfwDWDkkBm840X1h5Sx6RKFodTEE d0cJ0mRZq10zXzKDW7zjSuAEezTMaAzBruB05GRIg8XZhWlvaVGNejBpxYnFZVU= X-Google-Smtp-Source: AGHT+IFgNRayDgp4fmiIWVjZ3HTGdr0hITo8YBBn478cm5P7zRV+7T0cFa+54xo2Bary5GIFiosIxA== X-Received: by 2002:a17:906:c143:b0:a86:8368:860a with SMTP id a640c23a62f3a-a86a53005f6mr518996166b.35.1724596473780; Sun, 25 Aug 2024 07:34:33 -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 a640c23a62f3a-a868f4862b6sm550625566b.170.2024.08.25.07.34.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 07:34:33 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Fabio Estevam , Jacky Bai , 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 v2 3/3] pmdomain: imx93-pd: drop the context variable "init_off" Date: Sun, 25 Aug 2024 16:34:02 +0200 Message-ID: <20240825143428.556439-3-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240825143428.556439-1-dario.binacchi@amarulasolutions.com> References: <20240825143428.556439-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_153436_745868_B3E06D54 X-CRM114-Status: GOOD ( 17.09 ) 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 --- (no changes since v1) 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 fb53a8e359bc..25ab592945bd 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, @@ -128,7 +128,7 @@ static int imx93_pd_probe(struct platform_device *pdev) domain->genpd.name); } - 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; @@ -144,7 +144,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;