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: 822423 Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (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 75EC01E4A2 for ; Sun, 25 Aug 2024 12:36:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724589394; cv=none; b=HWsAYBMCQnOCRD93OeVmBJ3PYsi+YvlgC6NA93zLunZisdFT5tliaFUMPe/I100yuu2Ood1cNeBARYmeB3ZU5hUu5wcDXNIZerkxDfSypShs8W/cHN128LSkJwRW2oCjvhYd7fdZjLNT6q03bJ7lRDgEZ0EPjxtQiPxnWKaB8gs= 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=ggfYh7Ml; arc=none smtp.client-ip=209.85.208.49 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="ggfYh7Ml" Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-5becfd14353so3797736a12.1 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=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=1CeKLJiREErcfFDmVmFht0rfeHvolojmCG1SEp0D9eA=; b=ggfYh7MlTwi4EfX/1FMcrgtSFlClmR57kHVhzQkAYxggIgdkbNE2xx/9pZ7WSNsf7U SREoXu8BrVBdUNDpwT5+P7nZKH21LAL67h9EwlMkR6N3mH4pUJd1ZlAYxp3vax2tcnyZ T48FqWRF15uuWrTnz79PnK2glPk9UIA9+SUTs= 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=TjAEpSKLkbjo7hNTaGzxaB4mHjAilnk/80AWC4VFfTns31L0YC7e3QMfzXOkGX1jzP 4NhMKY8zATGqVsZ0uPWKG4tuPizJIWNaRDwhd6zNXQDySjsTnV1/AqWotV5MtILPUYD5 5Q+ec9+8yjpnseyQ1Kw7+aXNXcqYLWEDfFAV1yqsVpwqMI8laYWk6TmHnQnbp6l8ZztZ bfzF6MyWAt5GzOVwM4E5kxX8rgNUDVPg8UZANzj2JK2yweCepvrbGC3Afvf9+gc+W3ng +eiWqwsy+cl8gT/g4x7UZxs+bfr27TU7fNM3kZm54QlXPceVxjcds5PP5zA3Qptf4Py9 TTUA== X-Forwarded-Encrypted: i=1; AJvYcCUzlFNai6x/zEzeP7CPXNPj4bX7kKuzXG+DHCaHUI4vEO46YHjj7TgGoOB5F3DfG9fF4wPyD5GoCQ==@vger.kernel.org X-Gm-Message-State: AOJu0YxFuSJlVPf/8Ts161sxQBF2+EIbhyeA29WMMeG8sezEjuwwsowM 3S3GCS1MMSdyPD4jVxACgiYMkJguLpSADD3Nm8wZJX8jqxdqodDVWJmZ+U1EcWs= 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: 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 --- 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: 822582 Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 8ACE613F42F for ; Sun, 25 Aug 2024 12:36:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724589396; cv=none; b=TtLWfAUNd60pEOa/t1esmd2Am8GK2tBD1wd+l7w4r2ccZ4ocGVUkR2oQT5gB1VYjQ5vj5G0fCf9hK2+s0RDuTcpQTT8QFdWyr6qZ4jaKTcIRP3e92rx1IMCEBPRIEahL7hiJ4GYkxE2oUHhY5hTvvyQeP5+aLdeCpS6mWgFPZKU= 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=DAH5xNvk; arc=none smtp.client-ip=209.85.218.44 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="DAH5xNvk" Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a869332c2c2so503548466b.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=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=zf5APENb9JvqJNcRLDTY5Ylob0hcYN8J/GA4M8ib6BM=; b=DAH5xNvkmDThFTARY/F94x/+osTRS7ZzHSXQJltZJNtxBRTYEZMbVudaxhizX7Jo+2 zgxS3MDN3Y3ontmY1yHF5lPgtZhr5ClpzyFLBV0i2MRtQYQA3BJYBZ71srjFRKhLq1qj kheN2GE6uQNg9kEE3HpHQjBHRrsCdJRPtWAwk= 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=ZmaWvql3rtlUyaq2/hBTg+IQrjL2sEdh6uyeW9wlvMO6icLdEooZoGPNUQLF+WVeJK fAWwQm6fh5hrjk3imjQKUPMsjSkVm7kml3QVKLBBOroSMtmNf0PBFT/wLK7NKg7x5z24 eXKxqc9jGh+DobGl8Y1qGzIB2kq0WRIJinV/P8khJ6UR3sWwiIW+xEQz/XDuRi8dHzhM qW+O7mP88s99HX2AEwTqHZfxJ++sT3Wz7uh/TNgHDCUwj2ZWYuLLHDu1t5gQiwz5EaIO IP6Xjfbl2YVvefkQWCLd91Btn8DeceC54P99NSAj8CM1YNZ9Vt7jYhqi/lxuqO3UkS3R HbGA== X-Forwarded-Encrypted: i=1; AJvYcCXfZZzH7ZW088GMqgP2F9wnL2fAmV4Xx8CkESZp50Scpdelo+N9NP5xhJHwQaPXUYhyRkDoL/BxPg==@vger.kernel.org X-Gm-Message-State: AOJu0YzAEtDVFAXQZIeuXJ7n0HqFvl0GuhvdMy+y8qMoQlXuE378Yk92 2wytAfhFUAcfg+zIGa3An2xuwTvySaPat6iQSG1iS3oiIPUjctk+jcBWPrseFiU= 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: 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 --- 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: 822422 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 3F001153BEE for ; Sun, 25 Aug 2024 12:36:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724589397; cv=none; b=h+1XLw1D9V1sg91bhRLmEgQhtzrNXsMY62am0t0h0eSd4jMtVfJJGiSj+CjzS8JscAI44DTgrhXiM7xue6z+CAVG2hJno9s1wns1qiRFi2RXrbISe2pFwCTQllArT39IvPEA+bOn95AHbYGLA538SAlIjGy+EO9b8uaCAk+88DU= 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=rX1W7x5Y; arc=none smtp.client-ip=209.85.208.44 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="rX1W7x5Y" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5befe420fc2so4234101a12.3 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=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=ShHuxvzlojPRFvc9Ew3ELQFtw3sKey+UcfnKn9H3f6E=; b=rX1W7x5YLFYizJQj9tsNI0vJP71LMAUih699XmhqvyVMYrKnK1DNnLHLpdHmV+knLQ I7jI10f5VtukyIniNjKDGu/rWuldZ3j9ao1vz5M+IvcOJYBBtTwtpl6K/sOkwVbZJsPz In+MS5ZiZm0Pj1HcAEkasib6ZzwV1TH6q24I8= 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=mcCIW8XPMkkPRM2pS27/0hCTryFpuGjuT6f+e7JbTkAGsBRBPCztpfXzsT/7pks4xq 0WNDlOVONtELcyT1IR7WtH3/J2nA8Pui8jrm+4rEGJj0EddQrUpy9H5S076Hh47/20nF P9UnnY5aFAnLLAYVyV3xKVgZqiUFDxU8YGyziqnOaMZTLMYEHFXXODFV/aj/lDz/rWOk nM2WF1hCXj0+QNj9MXX7ILwyLLHGrFXaAeSvCIFL/CsW+nR59jAU/ZjCn+BGeyelyRwq tMe9TVgB88Nr76O8bi1w90RWVDHC0Ogbcv6EYXEvHKX7KKfjirVlbyGUJoOwaeasp+8q im6g== X-Forwarded-Encrypted: i=1; AJvYcCUMnBGiJBLxR+wz9O/nTm1bX2JunVbXO2L7w/4tkmbucshcgTx/TwKw/elkI1GJlDrWHRl0wqoJ5A==@vger.kernel.org X-Gm-Message-State: AOJu0YxuGTdUq3iz4fUvPQ1thx1e/e7FLwiOSKyNDidVYKFRNxyjzlL1 VEArSLaoD+0MSqL2unWRQBYAgM2Ytj5bycUky7zZpuNuMW7/n2SQLEKTr6KuaPo= 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: 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 --- 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;