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: 13776742 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85F241E520 for ; Sun, 25 Aug 2024 12:36:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724589394; cv=none; b=lwQi4SVY8EHBsQYeImF5gu4RYV1yrP1sIGm1qs0+hg/7GaBMB2GUWou8vuaTcvA/v/VL29mbZB+349Yvmvs2zBtx++CqTTDPgxOGbT8meObBKfJPfUCh8O0hDXhwi7y9vWQdwkPBq9DPl2dZnaGJ0TZE7n1eLwLR61r8N00CjK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724589394; c=relaxed/simple; bh=6AXodfhsBb1FFNtIxaDf38XHEgg7CfFzYFaOmts+BKE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FlL4C2xYiujMwXvrakdJvKGdSoi7D28EFFablK47z0nvKjsiRX2P4ffZlbbIZvgri9OOndvZgD3VGcuMzP5yIeZT2GLrlaowf+8RhMg+Z4l8cfoSpWvctKVSYcP24YJJ6tDX2Qscw2ji95CUQZro5l1bbN7HCgrnFS+iOYcagPc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=fAYH13yp; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="fAYH13yp" Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5bed83488b6so4026006a12.2 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.linux.dev; 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=fAYH13ypgmXdT+UOJogsCkyqdHXnl1+RO4nErlrm2CJXLxZ4J4WIcu8T4wVdlGlJgr 8yYz/QJC9HhBsbHJXhAGV40o2tvpy4yyxl3H8MEAGwWc5MKtapB66fmi0TELMVOtaVZR hrnmuEA2EByIDCz7RNwihgvuwGP1Z2bn3fVMY= 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=CMCMxTSpkLCF3++Pg3kH//UyBJrfoRhW7Znl3a6Cbz+t5L0W36/svgF3Yh5JgaoN22 33Fw+B4+dJmlFLwkWp02SM+msdah1LZvhTaKPBfMO+dOVFM+g6dR3kGilNKFbc0QekfY Fgu1Z81tOtw8ofG+mlT6gz9pGPR/naGqXeTahpLyiAXunFS8h+60Nax3E05BY0t/IWlW 5LnrU/mpDU9t0zG0uTR9TbNpKF68XEXP/5TK97xm5ugyQoMO9zFJy4NeleuUW3oWddPO D/NOmydvJFYToiqxVQSb0vwhmWmxYZg4cXae8ALMm0dGETugXVceTtqDaB0wsBa6IzOY uZpg== X-Forwarded-Encrypted: i=1; AJvYcCWZZcFNqHKLZ6LbM/5qTpyMCKj3+cmiABeOkGSeHdwzzuJ2HFt3DKPwErZW/IdvXLFsNyI=@lists.linux.dev X-Gm-Message-State: AOJu0YzhhA4NgQeNivzTdfZ2NCzWUiJzYz2NmDxAnzaOJnyKibZaMjFy GRmGCHFypDiB0gNCSauTCUYo6uc2nDG8j0MPVX2hzzYxGjk8SSS0uVOVHRmYhvA= 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 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13776743 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 858E113E3F6 for ; Sun, 25 Aug 2024 12:36:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724589396; cv=none; b=eOo2U62FkQjtZjLz+zyt29PUrphPzYA6nYJbumwsc5SNyDANrwsaPRriRFQZSuouSXYxDzX+tL0afeInnRCVz+C6hYMObA1ryTZ52eaQCPLgSEeSlUH59OQWRmN0/1HZ8Y3TLg78PoCPzP19ow7X/Qz/nwV/TSKA0+xAPFyF0Mg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724589396; c=relaxed/simple; bh=77c2NJVmdWrqGHVnDc3yMW37k+HNUe9SmurV/a/Bhrg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kNvWodKY71LLEdACbMv1Aisd+zE8D0Cm7eZUh0wFxsL2vUUiDgRnDsKXREyk/FZIJA9ZHOF2wzNwCRWu2bMcifh2l8aIZ0yHEz+kcp5q9Z+3LSPj2EwzfPpEOYbHQAChIHJ8v8TWMhLFvFLdYwuIM8ch3uewt0M4YIUAvibs8fk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=GMfUVm8k; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="GMfUVm8k" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a869332c2c2so503548566b.0 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.linux.dev; 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=GMfUVm8kuDNVxfxA0YaLlfWid+pZNoKcA2ZV2XgIZfXJL9sYMCdyXLPli4A18Xfi5F rOkHqBbvYviNcsc2F3vfhPu2fhLgnx5ZpXqfjX2pU5Cn2VTg4rh+NkAFoRvzc6S565jZ q0Nv4cshgU9PMyYdbmgCI8cpsjhLmpT+Vsry8= 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=cI95WUR6FERAchdOKixQ3b00madgHCzfy6RhAmTn43wNbuJCMyNpennhsnehfNsKOr wauEG7ejxnst2D4zUYGRk6l3oiQYH9NUJYqTpQ6L6xirjv3hSFbLA7ic8LrnUKV6LH8P mEOv0vlw4ZBKNMGAAeMSz7rK46ORcTi6KI9Sco/0/pTBB/Hxn7+ZqjC5tbK/i8NN6xJL +PaKlIIOp1HMhZqIh++PR4nINWABLga3eeKpWgSLl8Wh3dSDr7EUEpmdTAd4XhXmTV/J v81jfGHbCi1w/bCeX03WHVR7xfSZ/SL4qCdD1jX6qf9gWrvErACjU1GT/ATfF1iRs8XD BEIQ== X-Forwarded-Encrypted: i=1; AJvYcCUCAyExqTlC4LS3VHKjZg0yiqrjyVy4Y51rmFdSRnQmJCndAP11DV4W2ChV/3oZRCmkROs=@lists.linux.dev X-Gm-Message-State: AOJu0YzYrE7YQTLpjZyRZ+gfw85ZDHOB2L0RQJRDtwDJkCVlJh1AI8yj /aVKiEq87IuBOh75j5LWTC2SI4MQROlAh49WTSrVrgW9E/WKpNL/MixMye63UVk= 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> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13776744 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 228E8153BE4 for ; Sun, 25 Aug 2024 12:36:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724589397; cv=none; b=fvqpXTXkja3a2TkWXzYNhxxQHhkPw/x0iZAup8hf8uSMChWoVzHaB53f6A8MvJQBdX5d4K802+3r0mMqkZd5jAMBOj4nzAvlZbRyj2NQ15nD32OLZGd7STKO7zApwQsXDkesUDFP6yDrFYuj91SS8LV7uiAj8JC6MOP004+oSF0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724589397; c=relaxed/simple; bh=CAZxtuDPHzEmANcNibDepTfMA9FDdn6lpDoN/UtAh34=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b+K8aZ0cwpqVBeYCA1cSPnswN6yEK7okrqSTQup8X3X0k9exddzgFKL5YZpChckMq3yz+UkV7g9p96lWauhOaqJEzDZeDC5jdMn4v++TX4AP4WX3GNuGYpDxwmllY84krShcJnEFVntHdE1U7y7qLc5LW80+eBNBbA2E623RX2g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com; spf=pass smtp.mailfrom=amarulasolutions.com; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b=hJY1OXS7; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amarulasolutions.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="hJY1OXS7" Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5bed0a2ae0fso4252215a12.1 for ; Sun, 25 Aug 2024 05:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1724589394; x=1725194194; darn=lists.linux.dev; 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=hJY1OXS7N+sCAr66YKHKJ8j3lPU7R+JUzK4gMr2R2iHNIhuk3uDCTNcL1GMTK/8+AJ 2PUahzMKDv+wWaSE+vULcUoE2EH84fAYYsuO8ZcZMvkz3CLthmSSbc521J7gLzqUNqiC 3VE60uFKur63Hk9RZ2mtozzzJrzjyZ4s8NvDQ= 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=eqqT+qG7QjA2VquuTCB6PDEg/m5vOddcALvfrRD6Gb5P+QGh/odzAgvNmGUuY1e9ks KJKD5HQFcVhJlo2UtlcAHlkOF+t87ISneVAbfES/nvN4pwAhINBcFao8sKM69ch3fqhg j52o+D7K3WjRMDatsv/vV1tpGoT01oYg2/ul/H4TUiQJ8Z+zlhpiqbFFvkRJvXnEVKos xqyxGsSWiTD04Wcbxf0aUpNSIUX3MHC2Fqv5BXjgdX0l7NfzRYVp9Dg+kB3SuSF5HfDm //RUhhWMavGx7Qs29OG7uXu52M9BIN3cR6Wp9GFJMLJsgX1xcIP3jXaKHQPq5o8maM/x O8nQ== X-Forwarded-Encrypted: i=1; AJvYcCXYJPERQL8wZaPh//Jf+jPCqBWnkhC/8Q03jXzubnXe9HGRd555dY0nsQ4flEyuwZi4opg=@lists.linux.dev X-Gm-Message-State: AOJu0YysIGRzwmX1zM1/EldoU5yOUmIQfJoE4yo/OYgUhpffk4RB0oqB DcxUlkiQwkqmUA9dAaCX2TyMQMP9JSCBbHufIANrhzUy8F4313WbJIfAKvfjnM0= 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> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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;