Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp522705rdb; Thu, 15 Feb 2024 07:18:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV8TklJmR0+b1SReDLXMNUee17as6F5q0386kqZY3X43T2f4dOfE+jPQOcE2lg75dPdf5+2qSHwFHNZkV/lO2cBzLUbHor0WuF+XLiMVQ== X-Google-Smtp-Source: AGHT+IFVViLbmfwslShxRcWLAP15bEKShKkrmYdgOSTcE3KSqLBVULFfLsoyE2rzE808EtNgq9Ii X-Received: by 2002:a05:6359:4c1a:b0:17a:f91c:825b with SMTP id kj26-20020a0563594c1a00b0017af91c825bmr2213750rwc.5.1708010312326; Thu, 15 Feb 2024 07:18:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708010312; cv=pass; d=google.com; s=arc-20160816; b=FZ/IkROmQFIOw8Q/JE6zPyvm9nDcDQstdWwhhzT/SoQtA6sSDTawNmVnY0Z4yVqPe1 xXpkGcu4pqLCHbvkU5RK67BCHRI2z3HVsTkwca1XYG8DrT+T+UHXJ4D+vkbZbLI6fztm dXPSvoZBtPlZHHJCQFzXxqipHgeD/HmoHJ7BadUFursEIxyxkZzGjATO5vsx+siExWIz LTQCYSF35GpETRry1ederIunsjR4QrgUdOReb3KEFyCqs3GYxfpZVMzaUXwFc0b+HaZU p5IPEX9MBLUAUvoHOv6KQqfsdm+ZBeZukHPUY2FMkC5zBxzxjNSWL1gKKeOJEEMOj6Tm 5VRw== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67147-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h70-20020a638349000000b005dbf2871fe3si1204383pge.807.2024.02.15.07.18.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:18:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67147-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67147-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 06533283629 for ; Thu, 15 Feb 2024 15:18:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7AE02133298; Thu, 15 Feb 2024 15:18:08 +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 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: List-Subscribe: List-Unsubscribe: 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 , Bartosz Golaszewski , Andy Shevchenko , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas 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 X-Mailer: b4 0.12.0 X-GND-Sasl: thomas.richard@bootlin.com 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 --- drivers/pinctrl/pinctrl-single.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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); -- 2.39.2