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: 822421 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 E16A45464E for ; Sun, 25 Aug 2024 14:34:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724596475; cv=none; b=ro1svkdP3eL/ZUr/5BXXuYPb44D4oKlMSJ4Hc9X+LSi2Q/byv/lqlZRzrRVvEbyA6mJ88eC8jeRxEMDw8s0fLdLAWORpnmP3Ze/B46SWC9nd7NH2/s+A5VdraqzQ+AKDWzcRfhOTHlJvHpyVudsSwMxsgDF9N9/EeWAOETwAg/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724596475; c=relaxed/simple; bh=Y4w5OHB5AAqQgw5YqBA+ey3TPocL/Uh/eEew5lcaGaA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=caqPvN0vIEEsa0mf7EH4vEvxifQclLaIdAZR+Le/YwZ3WiBDCKWId3cOOOPk/ENIF5j4MmkYOxy+Dx6QsqNk/A1EnNRZxTlmbnTYxrFXfOUthGBJ9U95mgZwche5KHHP4eYauoz/TF2USds1H0JOC7LQRptIRBM0fd5EH4XL4yw= 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=ihYMXAN8; arc=none smtp.client-ip=209.85.218.46 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="ihYMXAN8" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a8695cc91c8so362554366b.3 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=vger.kernel.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=ihYMXAN8P/oS5Omlvw7LKf0EmeqiN5gVWUxQdm+Jxifh6b6NTAQRmyHvDlNO0yRgcO 9d3xw3M89fMfcuDN1N/OPqUddkRNOcbCqjZ7JHOsjx4gJqNeIuoQJrBREYV8Ew3dXp0o 44G+q4E6m6UVpVRXoBUoSpyapGYYdBzn1gAAE= 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=NRI7N0jdNHDl6ex4zKaj1RePfON3teMnkNnHYssILf6QyLCAWl8mOSob/ZWRC4II39 UBTB1uomlqx235czA9ta3jebFMNLmzHPDNUI+m0sEuP+WFvEx1OB4w4x91ZcIgaLY6xc zrirt9E7QzycxxWF5LU7jC2wYRge4woKR7OIk0CoU7ugObaWgp0BJTPO12+eEN5YDEse 4y+nh61N79ioNycwR1PBDuOh0FeDNCjmVNHNnMQaph0l0tgEjSM9Mw1pCCyWxNFd8ZuN RYtaObFILiBqVrcjxu+hXyi5cM8zfRBgGNKBH2BInJn8bPdzTQqrKv0/u71tIJAYXrVY Y98w== X-Forwarded-Encrypted: i=1; AJvYcCVk6+WPdGGYLjWbz3WNP224u+oVCw49I5xRA42M+ltBCLf+ve7u7s4ZfZGRSwex9hecK7fixEEBzw==@vger.kernel.org X-Gm-Message-State: AOJu0YzkLkJ88wSd2lZ8VxAP2yfVeJQfld7M3JkX0S10XGusNqGmJGSA vWzCm8Hp2ntLkruMDozWwUWVOCmpPBuCAhwZ3VSt/SbLb+PhwPEBHG9g5M6ZFxM= 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 Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org 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 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: 822581 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (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 60DF913D518 for ; Sun, 25 Aug 2024 14:34:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724596476; cv=none; b=qkaxGfuLVNe5lwkiK9xZPbFDvw2dx3jhD3l0ULx0LUktCxc8i46eWGpFCaJAJwsYYc02pB2aotv18at3Pz19xi4XWCgN5Kn51LVSqtc2Kp76DCZgGvSXh2+uefXyV6mHNguX17A/fqDhLhkhKl4EJAXilNChk5QhL1HbStCxagM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724596476; c=relaxed/simple; bh=FJAYltTw/vKUew7y1T5RlL01/wrW5nRptSnGTB1MgLk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JhkpbDpKdgn8pTE7wNJZV2Y61s50SAjqhE4pEJU/UKiRd31GDdv2PHTvHwWD/AVI7ixXoem0n+owyy7LoebqHszYjUggjIgHX2vw13FjEFaKV4bSIgrgrhy0TKX1gzF5W6nTc1D8OH4fw58gJ/KO9zhciXmTu3enEiAJVJZTtvo= 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=SgoVhZr0; arc=none smtp.client-ip=209.85.218.52 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="SgoVhZr0" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a86859e2fc0so411072466b.3 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=vger.kernel.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=SgoVhZr0EfLB0dI24M6+tf+w4vfTFS7vF8UZeExAOY9kjQgsuSvNpULQRkzxBjl+MB shbsoMjYu2EVWee8BZePEtQCbvWCC7wv8FgszCDOwODS9f5+lMSW01gQAP6Hy158+zoL ZL6hSnBZsthH9BOWHwHdP83/736LXMrbTOaIM= 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=W7rrZC3AiYj00V+vi4F5Nw11QWgONPdo8e4qg20MjDEf3xOQQ9zPIXZ6VScmtZeo9B hSlo9dfXEKbJbV4zbWZF3qAhqPLYPZVuA2bmrBcQOPMYQvsdhix71Ox9yVdFrETk4kBF Xrwb/WkNBELrWdXDWZMumHBmzuPp81SmCF/XDdmxTNgvKmGIWMCCaBPYv4VEPpklFiPL vXyGoT9HEkl28pICUTvuIRzSkudIfD3a3lxRop1BKTE8AGlR2UrVGYU/hTzfRbMpXz8I AN9HduJaTSr2g2t04eo7JhKCSj+Gtl3wyw2CIFe2SJPrOpKaSs1yPSHSSLjgQXyo/THY qBcw== X-Forwarded-Encrypted: i=1; AJvYcCWrup25RRpbMgKtTcnS4IP8nSRqW+RN0iH5/2WP9z5pEpBvNnCjXszBvEBIbiu+QAAZMfmBsNFGMA==@vger.kernel.org X-Gm-Message-State: AOJu0YwPLL73aiz3ZKWB8aAwUhWA0ppMFFNYHRaKowWIh0pQX7wijZor QxBuL9IIogfPru9XOEOegz7HWtT43an/c079t1kX/3tl1Do4pfHnxDF45hVZcd0= 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> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org 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 --- (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: 822420 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 67941155742 for ; Sun, 25 Aug 2024 14:34:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724596477; cv=none; b=ZoTHcteluOmWFOp6qzekWkO8W63BkkGQwHy6fSiJfErDG363RIKlDfQ+/yto2efBFX/Zndvpbi1dh7WURG3O6Nt9bs8ZLy+qFMZ+yeJMQWJpjDSzJlbhj19zqsBe4pvkeD4i7GTEb4bBCJz+qG5MoJcrfiXjhID9mNrz29Rb020= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724596477; c=relaxed/simple; bh=0lv2+/R/Y1kEilZQGwotVCHUco7bj6y3rAOycGgHMaw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BqfLWFP0Uo+ka6Q5dAyDNf3h6qyXkNzgpHVE9gHmxdB1Bdj8eOPvzxJsq9wOhXjV52Lq1tsTDuUWIoj8VjqXjSIphEuXfdIAbeQit6MreO9s8MD7exZifLcIN1HWKRh2yTP8F9t38dJQvOf5qByt4ZzLUcF8/q5MU8OXheU2K60= 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=T41hLwyA; arc=none smtp.client-ip=209.85.218.51 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="T41hLwyA" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a86859e2fc0so411073866b.3 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=vger.kernel.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=T41hLwyAvWpX9mKA2U4aP5AqUIknepUthKOTph5no6+2aw7geAuIXdJckSU4Ey3pEr gswiX0T2vl9R0AvMoJLsvaTTb8mxl3nGPkyNEzruCuDfom4JCOh9PufcLjJ6bmjrmy3p kIn8/rsVmODxqjfYRvDSnAoV6M+5DKd4IPVgk= 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=pvhVw4d02jafzArXH4O2vmQ3/406hkqhnj0Bio+HeTzwFg7dTLiXPrJl3yAsk/28xj ZCnqH9TGlMp8we8lDH50xykPD3DAykDowqJTF+4sTxg+rMd4AmSGVn9aOpul1hJMo2tz xha9pE2XY71+BsEmMZgUrYIrHfyzWwU3QQ9fqNJEFPo9AKB+tj3IYsQ4ClbW1OYItdGN 9GiGpZ7d+0R3RsG8/srmWKdbP/Vj8MqKL8ma8Qfgf46ebjGfWuhgko8qkhcGj71Zfe8U FaIHTt7+UdiKKMZ/yiYXbOmq33CYaGlnwe/jJxQoDv/DUHYQueIKzZ94WvOc0hreJJ3A To6w== X-Forwarded-Encrypted: i=1; AJvYcCW4hOvoR+AnfSKgwjALfO9y2bdl7GtlRrlFbDwjkwiMCLNjQTsdxbGXowtbQiVWJjlt7zzazBJPhQ==@vger.kernel.org X-Gm-Message-State: AOJu0YzY3FQdBRAaa3p5IiPxxH4kG85ALQNLgdisyRHU3oFi1v040s5w b9mKUcUDOZP5yMG9mHON1JY8DyBHqL7URVqk3RAmEuTC1I1U4QOEUad7QT/7cN4= 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> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org 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 --- (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;