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: 3342 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id EF7873F1CD for ; Sun, 25 Aug 2024 16:34:33 +0200 (CEST) Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5c077d8cf25sf2922322a12.1 for ; Sun, 25 Aug 2024 07:34:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1724596473; cv=pass; d=google.com; s=arc-20160816; b=wPkEbzP8aba1ZDbAJiIFE89QI+tJyEiRkIGJFsDkPVH2M3ukuigUYfU9xV+t1umDdB VcdsGhW0XOAY7n4QZeZdpLbXHv8IELFBRiTsNbQaFkQMc8k5wgfHeYKk3Ftz0pCtbuKI phPGCsXxOJGJy0JzD9jwTndLLBa9s3tmB7VyHNUVGs3IZSqGC2TXjoKmUpNdlHCV1qIa hVSvCsGJyTzzuI3L+NUV7kyInRKVhha+7A/2TboIghfmQPkfbxL/0K4bODc0aT7iF9iO YJUD72fBYAhMU3z2qqI2bGDfo3XYGKIAobC4eri5tQZv4ZSMCI88nxpCl0W4ujwt9KZu JV7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=K33jWLDJESJfclfj74p+hB48yzKV8sWz2Uch7ugz2pI=; fh=FeErJa23Nu27LsUmLr745J8fWGI51uO/SItHUGNTbxs=; b=xo1gCcWP+H/nP9rE4n5xXfupMrR4FJX/LbyDgFNegPUF7gol6BwHhN4yl6s7bsRXHF 82gbEbrgkCr9wI1YbTfgg+pMxcdL/jXMcZjzoQVz0v5bXS/HV3nNNpwOkC5H/rV912Ua lyfHomBx0wMtjSMDnl+cSzrxvsp6ETxkAtN0+sTKP5UshWJVqKEh7ay/4S2hrhUnErZ2 istQe8uFdrK99N40NSpGsg5qvOe1T15sWw6uc9DiG63jNXfvGDrKqt9Q9OvPQQzN/YpW eu0Ch9fsKDj9oAO43phgaEXaMUJp/iutTxnUtbU6fQxmY7jKrlF21vTbuxggsj5R7Phg 2OwQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jKc2jUFx; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1724596473; x=1725201273; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=K33jWLDJESJfclfj74p+hB48yzKV8sWz2Uch7ugz2pI=; b=jNXZ5PzxfAgchjUWEi7OZM96nR0rlzltuavxqKe2qV4gDS14yLlNT3s+03IcK49q7v z6oVj3jne3z7pYLrQInBfrXRhuNFQ6q1WHlwPWbFOFVTyoigEs/FvkvmMq1u2ZzAhUdI mnRaUeKS1N/g4ROTcR2mO6APfgVYWaizWIg40= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724596473; x=1725201273; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=K33jWLDJESJfclfj74p+hB48yzKV8sWz2Uch7ugz2pI=; b=HJxUMmSL9W5k4HHeywLAdVTD6WdHG30JbCcuSilWyJoDfmJLDF/Gtkx7DvJnFcZc9i Ai7OtKiFz7ULiXXRmdkrFbMXRrsNMs8QuiU+ug84qZsuIPIQhi5MEXQx+/0POhjR8Gll VYuonqeOrkpKiDD9p2kYR4fwaJYXKRIehn6tSiyboY1gqKAMp8bylLtES839sZTyPdv2 zZa/2Fw82Yc+JJxnHPXjmHgd8aLrCDpV3XCA7lnn0vdPTavpz4oC/YYgArQMGFGsTLT7 Jpy/9W7fxTMzoGQGa9dQNSokuvpYZ1ZPdiAPz/hkb0dP4TAtFsTcWRLxO17IELoNrHDa LStw== X-Forwarded-Encrypted: i=2; AJvYcCXg852veYdVoVP86NBCXu3TwHQJwy+O5cKgGV4D+BjJPOP2YW9DPrQxJCa3Dde+ISintmE6ZBwLX1dfaQjG@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YyvnVUIONyCxbGcKknUP+fs7qeWidzGwShkuTEwY876C2gMc/99 8jDvJi2c3SqlzejiP16iOVA2QNnwDEUrtQ5KLHNZdtMuvnpuM0ztTAcJcQa8GcLcGw== X-Google-Smtp-Source: AGHT+IGTdqjVGLEYxTDAQ8iv7wGY2zC0asCtXkd8tFEzMnf/5yciOmTI0tOg+rTwocUDh6WYY7HIdw== X-Received: by 2002:a05:6402:26d4:b0:5be:eb90:183c with SMTP id 4fb4d7f45d1cf-5c08915f4edmr6961042a12.6.1724596473388; Sun, 25 Aug 2024 07:34:33 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:40c6:b0:5b2:d0b8:74d6 with SMTP id 4fb4d7f45d1cf-5bf62d017a1ls116489a12.1.-pod-prod-08-eu; Sun, 25 Aug 2024 07:34:32 -0700 (PDT) X-Received: by 2002:a17:907:7f12:b0:a86:8524:2558 with SMTP id a640c23a62f3a-a86a518a3a6mr468977466b.12.1724596471745; Sun, 25 Aug 2024 07:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724596471; cv=none; d=google.com; s=arc-20160816; b=Pls6tCXGss85IaYwuy1SezLz9ZdIKgCKfkw+Ivdkfe1p2W+ARgmXadf6byCSyCEUVf 6dMKZ37N8nBs+pNJkEFIlWMyXp7a1mZf/KvFZPWa/DnJ15EDceDSP2oML5IP0oAl7Ir6 td7CiWCxTMS9gE2W5ulZLxnfc7b3nI/Jb9UxXomt9y7BHYqF32DlVxmlnhbvJ43W4Hgg DsMGzQqN6vvkhFCnKtOHwxnQf2xyWimCiOADirKl1bhb4k7B6gR3l56bZFpxJSTMf0lg aaI1MGB73BLGV/G+rbh8HH9kMUwozeAr4DnA3wnPdwLx79Q49JWIABzrp4tPhrgFgrWQ +0TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=KJCtcmIB3UdIrkYLcVzOIpEPiO2wmd+dCBPvqHnV2K4=; fh=RMQhmkTu7bgaEiLnzX38Rt+F0277SIPRkD+C67pz04Q=; b=gQOT3qsjDPYSV501wrzXag4SKqla6RJ3GX2dqgUTjMX9V9Q4NhRxLfpOPdo7UquFyw 2aOYWCrcH7kBBUfY7QwBQ75zrHWvUAVNw8FVEiDHL6SYvp4/hQO9E92WJN8pxkb580oh 0w+lEqrW2A3I1H2ITkI2aQufGNeYfIv8fe4hu0JWmP70oni8uB/8u3TVd4bG4fCoJRSf idGd4vu8JiG9KFJXlgucj399JOCrlxdZ5nPOxWxuM5wK12i0d/0Xj9v/0W4brWrQapL+ CfauZdwuc/DfJb1C1t5ItSlPTfGE6JvI8bu2Wf0gDyzYu4IAYYRdKIgS5955kX01jzMN OweA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jKc2jUFx; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id a640c23a62f3a-a868f32461bsor208047166b.11.2024.08.25.07.34.31 for (Google Transport Security); Sun, 25 Aug 2024 07:34:31 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; 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-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jKc2jUFx; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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: 3343 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B0CB43F1CD for ; Sun, 25 Aug 2024 16:34:35 +0200 (CEST) Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2f4082c7b23sf31022561fa.0 for ; Sun, 25 Aug 2024 07:34:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1724596475; cv=pass; d=google.com; s=arc-20160816; b=aiRMiaqk6skx31GSKZmkOy1Dk6Z/kUcFA9ZmSXMizw0xAMJ7QU6k1IkQ/COFz/736B vYlsOBg7evz314NuRdAhvcLiFWlqKIR8AZWmLaxDCbTCuF99Tnh8zKhRA8qH09ck6RMl 58n4npV+g+JXeGxKyFUYssN89s3fezg1lmprGDUl3lHMmRfQVvF5FvVi4UTEGCWnrPtS 9n/XlhNItYn2WTetdFIex3qGULC+xLKEvbgq6803YtqJc707dAiz4fVKsCKm92dypgj8 39QE90Preb+o55W6ui5eZfrVw4Dem2vCe04JEj/01Ci4iHa/Cg9zFYnchptpLcP0swQj Q41w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=aTj4wQwUzYgX41ClF3cTjeKiantX/OQcX4VcscfMrCM=; fh=mT2m6BquRxVinphUMYL1yQsRJn8GAUfAlnSZHvfsg4Y=; b=fNfYucQi0Ej+By7rZJQ6NzhdFdEk54cBY6rBto5SAEZAapmsUkGEEq5UJguDvmLkYZ CsTl31uTtnJMKHx6qdBVovM5Ky014/gQlt1PMJcAD5jvYu9y3lAq3grBpSDKxGE+CE6D 5HQ9PpdCZBMIJ9Qc+ZK+Jh+NPsTgteMPhcuqaI1/l7hoZcjinTuM3mlAM/p19SSG/zEz W4ycZQ1i/adNyEkcLUevkt1YVhGj6YoK0CmHMUzcda/orYhFmBjIL1M6O4nMBz0YPU2W cwos7OU3a8Mlug0fawjVKPshEgauDoQj2LpZXWkOGayuDmsNZLFt8j/87ZVtt0sHaDUX PJPw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kY6WQeHr; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1724596475; x=1725201275; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=aTj4wQwUzYgX41ClF3cTjeKiantX/OQcX4VcscfMrCM=; b=CXn0Ygw4ROPVuibHsLYNgfJwgo4NaRtpPZh6KkXmbxFbUlU2v5uFmzeLmakI418025 s6XWI5oWrjvsjryPWBWYA740EwvjF4aIo7oJCGqy/gL/pSA5NdZB8C3e9MJNvtnptLmI qaBBRVoD3fv5nreI+eNCakCRHlRg0uY0ttWYw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724596475; x=1725201275; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aTj4wQwUzYgX41ClF3cTjeKiantX/OQcX4VcscfMrCM=; b=J0Dx3mRA+pHYejJlWInd2NBav6dFmY1M6lLpX5rXSFrwRGU2pbCRUH228KZp3g5KA5 Mk5q/Q+qg+MIAVnzQzwbDjJFTE1WfFrauOBbI+VNFHOY3QSoQLjby/OcLLpNqRyDNozu 76f5s/niZDQ8F2/c58jBBRxoMrT7FKrdArLd7rP1bZH0srWYuW6lS3Q4bM0VyhAbG1L5 OsrOBsIRFKrGEJhNcLwZWGMH22ZJL+28W23cqx+ojAQw62dKuyUEhdroamA72g089ZSP 4aXtrJeUtUA1zxwi6wWSbgWid9nsREoVoDzmFM6tSOf2gdiNNTUV1vQX8zw/FNAdAGbu 210A== X-Forwarded-Encrypted: i=2; AJvYcCU/BrZxXt5HufLAj1IRMd0MKWGjoOd9y8lW7v2wAg57QCfga6tbj5Dq33ldxhniMXNk9SGR0We6HlaUDEsC@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxgfBTg6eFYpmpNT0qfEBOdHwVjxP+CLES6c5/EIgIGvIkNtPut +GGZ9DgSKaK+octCvqujhIceDuqAMzdJclkpdrPCFdnDaM5u6jp6QwblbtbCzm9fXA== X-Google-Smtp-Source: AGHT+IGqWGcaZpQFCKRuFjKjkKN0GF8ef9PXaNgMDuQqC55PE1gC6pwon0WiOolCPqk9Gp6gyU8DPQ== X-Received: by 2002:a2e:9b88:0:b0:2ef:23a2:7efa with SMTP id 38308e7fff4ca-2f4f4918518mr42722301fa.27.1724596474830; Sun, 25 Aug 2024 07:34:34 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:2690:b0:5be:da72:5baf with SMTP id 4fb4d7f45d1cf-5bf38f9afbels1599377a12.0.-pod-prod-09-eu; Sun, 25 Aug 2024 07:34:33 -0700 (PDT) X-Received: by 2002:a17:907:d91:b0:a77:cacf:58b5 with SMTP id a640c23a62f3a-a86a518ee15mr512242366b.1.1724596473190; Sun, 25 Aug 2024 07:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724596473; cv=none; d=google.com; s=arc-20160816; b=EfuyKdkrHkYgv6hg/M1X1Ne2Haqa/Lv+V3siE8/477JBEa/p8KbgOtDNTU/AiqMAu5 uovlFHbGzmHNi3mQdXOP0Isjw6pmuDQoU9Q6bmMnfLt1NinBaa0UaL8ZsMSWIfb8pu50 bTNddSOT+BSN8TNgaN/80YvohtKxyeOzXkYxiVVfea7hPpueR/6PHu/M6VBeqx1wO2zX sEniiNTzfkqDL+SgPCya9nZFOzN0Geh9MyuBV+/uCTv7dv/nJghoAd/NGtSdSKGOZ8Y5 cAkVKNt7XVA/XdP2GEEA7yDybDonq+VfxoM+eXRie2aFk9v7P7fDrGwBKpB3COORjZN0 SHKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=b/+WxYlkSCaxJVD+lANibTyIufP0s0obescAo/C5LRY=; fh=YXo5D1AQ/TScrBG87w2aLkKrRSRtfHlCai1RyYYeEAI=; b=ma3HstkeFIJh7YJ0WVCufv/G+L6D/kaAHlXQgq0yZsw7EzPehb7BNKQqM19TUJ/GyS LFxgnIOoVaD8VWdZteKnTeiy9RNKGihRsFB+sVIm2divSUdYUwY5pQLgEM7hMGnkwgEB guwj9s3HAzBueSkF1iKJOQqaHm/tHIVpx9CLkbgs1oomColCQhLIsnVRp4aQMgw7cZ6o xq7bvDyjvsIOfDUBv0RSMhub+A84X92TX25Y0mXKRpsr9t68mNQQHxCTZEyodAJ8Ffb9 4wdBuQr79nHmNBNtfz7S4GRwqmqPY5VL1eZp+8uzU8gWIGdB/aB3F9qNRo5KdvPp46r6 7CeQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kY6WQeHr; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id a640c23a62f3a-a868f34a787sor215863666b.10.2024.08.25.07.34.33 for (Google Transport Security); Sun, 25 Aug 2024 07:34:33 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; 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-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kY6WQeHr; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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: 3344 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 664CD3F1CD for ; Sun, 25 Aug 2024 16:34:36 +0200 (CEST) Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2f5084d2a66sf5290661fa.2 for ; Sun, 25 Aug 2024 07:34:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1724596476; cv=pass; d=google.com; s=arc-20160816; b=l0APzGmaCZdXZMh7YixT2+wyUJJvlgXaAobv2wA7z/jqM+1FytKhTWv8xQmJ3ur1aS IQoD5W+C/+6CLPwUP2TiyYyNdRRqSQxEidDAMfbLdqGmBwER+AnOJn55eWLo7vW+05G+ /Dm1x6KFaRm5VG6dHV2Zy0YcFZvEloXHmVLvnJN5GjCoqyu4qtoF2ZP8tOcUlGql3DLt m//w9YSov3fT1/8pNvJWQ1GlhXzN6O0Dff/y+1hi90s25zdUjrqIauiKUxthYzcXXKuv t4T70X3zPVyXgu7FhY1JKCMz6GWPku4Ko7xYEv4EEJq5U9+fW/WydVaklI6OBeNLeEGb RvjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=78yjK0UUalr5nI7Br3NmFybMFvvxIlWJYXpDp7MggwU=; fh=rjeQ3kWK8SRS95PPhuYXiBN4uN7hukOGBnHgxb4//d8=; b=nUNxljoBgdREh2tEXWHZfdWER5sUnSPcYdvdZc+7O3xI488NcHCcewBcJRmCUOHwd/ 1SMxQOXMWK0B855PBjRlz9eUuwG7KnhTr8cSu62FSzdwGGQ0w3HCTG738hf5J/70oSdY riRr0kqdtY7gfpD/KYO971jO5dnRSfIN7RXAh45x9Bu6gRzZcLYWomcUeelZrpkJzuFi aXsSPx2SfcpejhRtc4nwMZLqfYAfHtyael8ENluj7Eg2R4Zn39+7cTiWYi3xwgoQH5EK ruVArl5NPNcqftpRlWrwczN33ABF0uZEBQ9tXc43e4fChBl7Nvy4Se3+QzXwnVmm4Ydr mEOw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ANPbWVJt; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1724596476; x=1725201276; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=78yjK0UUalr5nI7Br3NmFybMFvvxIlWJYXpDp7MggwU=; b=VNet54CHCp8ETl7QH55uLpAmKS/8BHjTGUClKnzy7zQPzsyXAPuVI/NnafSRyDSrd/ VLioLBOcCGViAyKDb6+B+g6nhtKqcdwFVAhOyEV4n8xe+/zyC6v/vvfavaphl3mLjhpw xU0mnHAK6aFcwJzg871nLf4PjlW8uXITWwTEU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724596476; x=1725201276; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=78yjK0UUalr5nI7Br3NmFybMFvvxIlWJYXpDp7MggwU=; b=c4HJUuFYJkBD0hdTCKgh8lqMUjw3ROxeQcGV2bwoxq3iChgYNNW4gL4QiifOBLkBtl fJLf7oB5kioHVwmetG7bbJit2RPkHMip/yYcl7LRR4RgkwztxnScNv4uMFaYOZ2D0QkT cWHi3HZWWB/L2X1sBaBfAut/PWv6uIbxQgxwqDHQk43WBEhxcU8JxN0uhPWMPx6/3Jf4 Nd8Fyk9XiJJkqvFGaaFIfQe7fMhMVUTOok6bK3n1mF44IQG6Ed05R1Z8AHrFReKyjP9z nEFHwLiAx9Svpad80mb5FDZqfnKInmcwLioZtj9JOHLtaYL8UQu9AFFxg5HyYhreB44Z HJAw== X-Forwarded-Encrypted: i=2; AJvYcCVA4EOe+oMwA27Z+AT602czvk7s6KT5YSTSOKD2mWIb92jshAYOobn4Lxvz10ugTlDAfG17fqXxQ0RtgNn3@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yyuu6SFJ5sIUngvWqVgYkyGSZZDI/JQLgSopIyBiAhXLib7FS8l qnu1bNC0/XBhmtd/rP8OtlOATImyDH+LHVjHcwuevNaamu3dC1dXLyvFGsVxYB5/Dw== X-Google-Smtp-Source: AGHT+IFkPBFds+FPDUGI7/6/gliqVEUXLFRQqg6Dlqs9yDmbeOJho1fZpM1YDgggLWMX1GSvRZRfJA== X-Received: by 2002:a2e:97cd:0:b0:2ef:2cbc:9072 with SMTP id 38308e7fff4ca-2f4f496124amr44523711fa.49.1724596475691; Sun, 25 Aug 2024 07:34:35 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:2690:b0:5be:da72:5baf with SMTP id 4fb4d7f45d1cf-5bf38f9afbels1599378a12.0.-pod-prod-09-eu; Sun, 25 Aug 2024 07:34:34 -0700 (PDT) X-Received: by 2002:a17:906:cac7:b0:a86:9cff:6798 with SMTP id a640c23a62f3a-a86a52ec035mr553335766b.30.1724596474189; Sun, 25 Aug 2024 07:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724596474; cv=none; d=google.com; s=arc-20160816; b=VhGHyeOmupvVyPu7jYbAbzFjPlzqsNjq5YkO11ZDdMsVqn/JKVlDkuH8UDiQtFIxke hiGdniFUSpgntdYBn8zYf0zS6yM6u4PIMcJCqR4ApRmKlU3cZRriL8v2QRF75FLLuKtt Bab3eJTw/bd8jTOrzQmm4nSTM/EUJcWjGjFcGNlcrBF29UzxES3l5tNW84YJKPRl+pZl NsKaatOtnNdTHx8biRQy1qwSvdkNTXQUnAPXH+3ool7rV0yhuuT8bE4mQWPlVmhfm5XN gBD6+rB5ZfSlTDgFkT1E7k5xpgdznrixTmPGJ0D5Naf3MQepVZ46g8x15ViQDJRkIUmf 3tPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=pUP1tr1Biob0qdgqQZiV/8XgCxeEAXErXHQFm+tqx4M=; fh=rNolTRAi/pzvqpcsiL1SBguc5M4vP05RQPM5+uLgwX0=; b=Ss0st6YBSl9Qrl2U3QWBiFsrv5dfuSeqHOUZXl8jK33yuc/od5H5KI4yBaPaDgounR 55YsFg5BTKeYOpPHFKtyap8Nnywk+ooR8rvwt/p8sD0B40nh4IVQrbRWL2ovq7yWPj4d FcRuposLcY2zBpjyheZ9dVHRnRa3HsiJOjt+MNXJ0PEMmtUsJtvXXnyAb87OL4eN1c6g 4F6ukqurHPRQO/EDOMH2MEdNy8weT3qIGNX1qRok1gGYFBLQ0a5bu8cCEY3CDTXXoJBu SBoP55Ee880dW0feqdYzLq3LSScqPAGbYVw6wYpE1AMYdIXBoj5ojdAfSMYdQU+m5yKo ohTA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ANPbWVJt; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id a640c23a62f3a-a868f4e549asor206704866b.19.2024.08.25.07.34.34 for (Google Transport Security); Sun, 25 Aug 2024 07:34:34 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; 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-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ANPbWVJt; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;