[v3,02/18] pinctrl: pinctrl-single: remove dead code in suspend() and resume() callbacks
Message ID | 20240102-j7200-pcie-s2r-v3-2-5c2e4a3fac1f@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-67147-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp470219dyb; Thu, 15 Feb 2024 07:19:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXYI88jvqnX86BwK4bDPYvY2QiJvRWvJhoKicNVSID04u+o/8+YxDjFCK4l/XNpq5JWNYDqb2s2cxInsJ85qatOX47pgQ== X-Google-Smtp-Source: AGHT+IEGr1w/iWAdHahDRSss0oq4KdKO93pEN+MzpmcxY9DQPAKUaAh68EdahWp42DdLBke50zlG X-Received: by 2002:a05:6102:304a:b0:46c:f77e:6f28 with SMTP id w10-20020a056102304a00b0046cf77e6f28mr3288411vsa.0.1708010356579; Thu, 15 Feb 2024 07:19:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708010356; cv=pass; d=google.com; s=arc-20160816; b=BpvfKRV+YJqPS/s7Pj5bWt3s5XlL25Lr8VMCfPwlBwVyPm1h8apG7k0TPFrd18AAs0 g/NYAVeCFfjkBdSuNrWPMIzTDBatOjWV4maAom9DQrdqdD/EKhScfMNaOgma1u+JRkgi UKYNXI0ubGNKwdRo9NBPsCxhwj6DO1WiHfZfzkexTkQk56RLlrHfScEWX+6wH49r14lU /2IW3sY3VhSHdatLAIHWbMkUlpaYPydi2IGHujNRl1L/3yIc1K64AQ4uzL30pqUQQ9/Z TqJFLMn/In6/YsntDHcCTIsnQlWR7NDudh/YFOO27Lpa6HaAb5RwbHIjgUD0R/NuX9Oj +l+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=J6YtYEPkWQliDBXfdSpeuMo61P38HreYk7GRFYqtXkw=; fh=wHZQkXie84v2FP+2z7dUEuyvptHwnAyqgx34WxJkhrY=; b=F6dPD0ABcDhJ1nmp1/wWDswbG7xyoC5CdO4eny2VbhJAcdafyw/2V+zmO+MShNtW0H sKgkUUnb5zRCDA+U4T/IH50BVFBCfetj5Uq4vxxSlh51brQ+OSDmkOSAYthmC1bJ9v/A hcZPuZF26L+TmcOx18op/UoY6cmNM3UQZ8KiOE6Hf4YAAIeICc7RwmSf5EkdH7AP49g+ ma8OtJuoQ0g9p5W0NexlRK2CiVITSnAXBHqLoIEHmBHC3R/dal6aF6MF927BoXQe67pn 5aUVH/6FcDTaoHbN8hLgQD4q9q3Uo4kaeddfCKBJ+X0+9vkDIKJQEZWERgCwE2RPPFvc +SoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GWEL8kMT; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-67147-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67147-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q18-20020a056102101200b0046d2f3b6705si222684vsp.90.2024.02.15.07.19.16 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:19:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67147-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GWEL8kMT; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-67147-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67147-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 401831C2248D for <ouuuleilei@gmail.com>; Thu, 15 Feb 2024 15:19:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72006133999; Thu, 15 Feb 2024 15:18:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="GWEL8kMT" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB610132487; Thu, 15 Feb 2024 15:18:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010287; cv=none; b=j2eBLS0KkUbkBTeWyqm9m42dze9O7fblglvVacsYF+8ktL9j1chzgzR5P2J5JdT7FDFsvgz35Y/ULo5x0LK4+Qh4vP+fUbUiGcPMMP74uQv2lOhV3D5q07ovdyyhvfAFM5LHqkmLLgpzV+yFBW/WSCkAPan5j7khbtNRWsczVm8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010287; c=relaxed/simple; bh=NUH30x/9mKIikGBACPkPdrVWLNqgjqGCxMYohiQhXpY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Q6L1cHqihZvWk4RJsuLyXEAwn8+QrwX/56+O860n7pgq0t7+k3Z9oRyzBbdqVfsWTRknEHhhYPgW67QrPK5ha04Cz1+QVcb2yl2i3JYTDPKFUzRe3NVhsrIlVyStBABGCDi43T7B6Qf3kdIV/Bm6vMSAdMQ340ieE4Df423pBWg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=GWEL8kMT; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id C540724000A; Thu, 15 Feb 2024 15:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708010281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J6YtYEPkWQliDBXfdSpeuMo61P38HreYk7GRFYqtXkw=; b=GWEL8kMTuyWm7ECMBeYelFKt5Q6vwC0YFhuakiRf3NgJ4SBetjufDuAbCa4NJNSLtfIKWV ImLFqNcgDQYVLO3cbQuuw8NIoN4nnrh1b64RWoi0gQpI/vawF3LZXPoK/rifPfVg+uCD00 ilFkwuYn3JROW1CkcDFCvPNZuKBGle+6lYipptiewaLr8MT5IfZV28OhCL/K6W76efhLm+ unZdb1L2x+xQKZi4yw0LsR140IPSbJJI9VzZIhTmPRZjP2t+4mu8zR8X8dSdu3sDpvSLGb U3g7hket/T2SQvbAjCO7mVpT/AY81IVeWS6NM4U7DA1px1hAhBQcCZZESczqlg== From: Thomas Richard <thomas.richard@bootlin.com> Date: Thu, 15 Feb 2024 16:17:47 +0100 Subject: [PATCH v3 02/18] pinctrl: pinctrl-single: remove dead code in suspend() and resume() callbacks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240102-j7200-pcie-s2r-v3-2-5c2e4a3fac1f@bootlin.com> References: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@bootlin.com> To: Linus Walleij <linus.walleij@linaro.org>, Bartosz Golaszewski <brgl@bgdev.pl>, Andy Shevchenko <andy@kernel.org>, Tony Lindgren <tony@atomide.com>, Haojian Zhuang <haojian.zhuang@linaro.org>, Vignesh R <vigneshr@ti.com>, Aaro Koskinen <aaro.koskinen@iki.fi>, Janusz Krzysztofik <jmkrzyszt@gmail.com>, Andi Shyti <andi.shyti@kernel.org>, Peter Rosin <peda@axentia.se>, Vinod Koul <vkoul@kernel.org>, Kishon Vijay Abraham I <kishon@kernel.org>, Philipp Zabel <p.zabel@pengutronix.de>, Lorenzo Pieralisi <lpieralisi@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= <kw@linux.com>, Rob Herring <robh@kernel.org>, Bjorn Helgaas <bhelgaas@google.com> Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com, Thomas Richard <thomas.richard@bootlin.com> X-Mailer: b4 0.12.0 X-GND-Sasl: thomas.richard@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790978667619059804 X-GMAIL-MSGID: 1790978667619059804 |
Series |
Add suspend to ram support for PCIe on J7200
|
|
Commit Message
Thomas Richard
Feb. 15, 2024, 3:17 p.m. UTC
No need to check the pointer returned by platform_get_drvdata(), as
platform_set_drvdata() is called during the probe.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
---
drivers/pinctrl/pinctrl-single.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
Comments
On Thu, Feb 15, 2024 at 04:17:47PM +0100, Thomas Richard wrote: > No need to check the pointer returned by platform_get_drvdata(), as > platform_set_drvdata() is called during the probe. This patch should go _after_ the next one, otherwise the commit message doesn't tell full story and the code change bring a potential regression.
On 2/15/24 16:27, Andy Shevchenko wrote: > On Thu, Feb 15, 2024 at 04:17:47PM +0100, Thomas Richard wrote: >> No need to check the pointer returned by platform_get_drvdata(), as >> platform_set_drvdata() is called during the probe. > > This patch should go _after_ the next one, otherwise the commit message doesn't > tell full story and the code change bring a potential regression. > Hello Andy, I'm ok to move this patch after the next one. But for my understanding, could you explain me why changing the order is important in this case ? Regards,
On Fri, Feb 16, 2024 at 08:59:47AM +0100, Thomas Richard wrote: > On 2/15/24 16:27, Andy Shevchenko wrote: > > On Thu, Feb 15, 2024 at 04:17:47PM +0100, Thomas Richard wrote: > >> No need to check the pointer returned by platform_get_drvdata(), as > >> platform_set_drvdata() is called during the probe. > > > > This patch should go _after_ the next one, otherwise the commit message doesn't > > tell full story and the code change bring a potential regression. > > Hello Andy, > > I'm ok to move this patch after the next one. > But for my understanding, could you explain me why changing the order is > important in this case ? Old PM calls obviously can be called in different circumstances and these checks are important. Just squash these two patches to avoid additional churn and we are done.
On 2/16/24 16:08, Andy Shevchenko wrote: > On Fri, Feb 16, 2024 at 08:59:47AM +0100, Thomas Richard wrote: >> On 2/15/24 16:27, Andy Shevchenko wrote: >>> On Thu, Feb 15, 2024 at 04:17:47PM +0100, Thomas Richard wrote: >>>> No need to check the pointer returned by platform_get_drvdata(), as >>>> platform_set_drvdata() is called during the probe. >>> >>> This patch should go _after_ the next one, otherwise the commit message doesn't >>> tell full story and the code change bring a potential regression. >> >> Hello Andy, >> >> I'm ok to move this patch after the next one. >> But for my understanding, could you explain me why changing the order is >> important in this case ? > > Old PM calls obviously can be called in different circumstances and these > checks are important. > > Just squash these two patches to avoid additional churn and we are done. You mean invert the order instead of squash.
On Wed, Feb 21, 2024 at 12:01:43PM +0100, Thomas Richard wrote: > On 2/16/24 16:08, Andy Shevchenko wrote: > > On Fri, Feb 16, 2024 at 08:59:47AM +0100, Thomas Richard wrote: > >> On 2/15/24 16:27, Andy Shevchenko wrote: > >>> On Thu, Feb 15, 2024 at 04:17:47PM +0100, Thomas Richard wrote: > >>>> No need to check the pointer returned by platform_get_drvdata(), as > >>>> platform_set_drvdata() is called during the probe. > >>> > >>> This patch should go _after_ the next one, otherwise the commit message doesn't > >>> tell full story and the code change bring a potential regression. > >> > >> Hello Andy, > >> > >> I'm ok to move this patch after the next one. > >> But for my understanding, could you explain me why changing the order is > >> important in this case ? > > > > Old PM calls obviously can be called in different circumstances and these > > checks are important. > > > > Just squash these two patches to avoid additional churn and we are done. > > You mean invert the order instead of squash. Either would work, but see how much churn in terms of changing just changed lines it adds.
On 2/21/24 14:13, Andy Shevchenko wrote: > On Wed, Feb 21, 2024 at 12:01:43PM +0100, Thomas Richard wrote: >> On 2/16/24 16:08, Andy Shevchenko wrote: >>> On Fri, Feb 16, 2024 at 08:59:47AM +0100, Thomas Richard wrote: >>>> On 2/15/24 16:27, Andy Shevchenko wrote: >>>>> On Thu, Feb 15, 2024 at 04:17:47PM +0100, Thomas Richard wrote: >>>>>> No need to check the pointer returned by platform_get_drvdata(), as >>>>>> platform_set_drvdata() is called during the probe. >>>>> >>>>> This patch should go _after_ the next one, otherwise the commit message doesn't >>>>> tell full story and the code change bring a potential regression. >>>> >>>> Hello Andy, >>>> >>>> I'm ok to move this patch after the next one. >>>> But for my understanding, could you explain me why changing the order is >>>> important in this case ? >>> >>> Old PM calls obviously can be called in different circumstances and these >>> checks are important. >>> >>> Just squash these two patches to avoid additional churn and we are done. >> >> You mean invert the order instead of squash. > > Either would work, but see how much churn in terms of changing just changed > lines it adds. OK thanks. I'll squash the two patches. And I'll add a comment which explains that I dropped some dead code. Regards,
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 19cc0db771a5..02eabd28d46e 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -1693,11 +1693,7 @@ static void pcs_restore_context(struct pcs_device *pcs) static int pinctrl_single_suspend(struct platform_device *pdev, pm_message_t state) { - struct pcs_device *pcs; - - pcs = platform_get_drvdata(pdev); - if (!pcs) - return -EINVAL; + struct pcs_device *pcs = platform_get_drvdata(pdev); if (pcs->flags & PCS_CONTEXT_LOSS_OFF) { int ret; @@ -1712,11 +1708,7 @@ static int pinctrl_single_suspend(struct platform_device *pdev, static int pinctrl_single_resume(struct platform_device *pdev) { - struct pcs_device *pcs; - - pcs = platform_get_drvdata(pdev); - if (!pcs) - return -EINVAL; + struct pcs_device *pcs = platform_get_drvdata(pdev); if (pcs->flags & PCS_CONTEXT_LOSS_OFF) pcs_restore_context(pcs);