Received: by 2002:ab2:644:0:b0:1ec:cbc4:63fb with SMTP id 4csp1158949lqn; Mon, 26 Feb 2024 09:15:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUwRCZH3KsGC3oOO5nTcPkl7/IMdRO34xUdy++azoZZ90Zo7BY/eF2FmQolRrHxRsQgQIpNehWOT3q84zKa05MKHyLojLcmq3pFsAbV8A== X-Google-Smtp-Source: AGHT+IF/epPGN/dNRYXrqonn2vb8KqTII0zby2aZlOJBiJ7tdZbXSNbbdP9LiVg9f/djduNgPq7q X-Received: by 2002:a17:906:d0c5:b0:a43:7e63:69a2 with SMTP id bq5-20020a170906d0c500b00a437e6369a2mr1066902ejb.77.1708967713802; Mon, 26 Feb 2024 09:15:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708967713; cv=pass; d=google.com; s=arc-20160816; b=YdAOsysXPr0IqYcchTwfczS+qjMavJv7gHTnCsL9TQgaUW/06bKfH09g7bAdWs8ztZ ORVKh7Crn4NmmLepmi/P7GHEHoxUKzPl412114UTqVxL0PEW924zWqsZiC8r2oZusFw0 szZyRcn7iEwk3U5VX+eEj8QzlLA4bt03qksCL3U1DnU0eMYRnaj4xKE8TfgxUksnn/F1 f95B2/bP4glYn9UQuTgV1E2iituIqkG8KGYJlV90mjYtukWkg/LMg0TJROJykH6JqDOa pxi7SUIHFeFcoFPff09EUWxbhfh1CF1MttKZ/x3IYnUKAsrgOgjjCxPVhigiphhjcQSd AMXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Tn9G+qXphFLUMlqaCdrIW1lI3L/sy7DuNc4RBARSO5c=; fh=nXs/zBkC1fyGT1Fbmmp5YZLdzFQCtlsfnl+UZiYevqg=; b=Co3WD5UAOwllWI7h/8GYoEgCBjHRFHrUKVA5MebCwy0ZuUmtnkX7reQtt8KFPqrrCp uVZHtU6HQKbaKHXF5qyZt/2b1p+5dxgpSzEjaPPsY1QjTTgtEVOpTIjZCAdNTQJIP2aP Yg1eItEGyR3sdX9X1Qyva47YojApa6n7mTedy4vYr+vcLdAb3ITBikHuA9QAywrhr+Z5 3dxEa8UvsQg9/c3fP/OqmG4JGz0BjBAgS50TfngNiegN532bg8aXwJVnpjWzgrp2dfGo mn0+fKsOKzGUhYLaM47QwickvW9i6A0Szx1T7RgLNtcsXE99i41kk/UVODpuNH4x4OA9 HEag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=UwCcma0b; 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-82019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82019-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id fx16-20020a170906b75000b00a3f0d98c123si2306232ejb.560.2024.02.26.09.15.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 09:15:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=UwCcma0b; 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-82019-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82019-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 839DF1F2C301 for ; Mon, 26 Feb 2024 17:15:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 613A512F362; Mon, 26 Feb 2024 17:05:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="UwCcma0b" 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 55C0813540B; Mon, 26 Feb 2024 17:05:19 +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=1708967123; cv=none; b=J1vNLxJN4EAHzPHYLONOVE8/yyWyp/oGIjb84cnaknsqn5VZ8zg/jHimIDCRIS9TukvkN0XzSmE5/yrs7xXamudT+pPY5C4ey9uxTOuAGPd2um9wwfZGyTynH0kPKNwBcOoX5l6Cs/HPYP4/77tEfxrVLFFyHouRs3FCkC/LTGg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708967123; c=relaxed/simple; bh=ypNyr0Uoo5ne9ovtpSKtjzM4p27kJo/g2Xvh37ER8Xo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DyUOHVax9Pip1ii3a7Z6BG6m7+OU4xteOTUJ7tEYIfnL44c24U61QTySxJuW/ZWMqQd6bR7trBUqhwjBaqn4T44RkgQUo8yAF/TlgUA/SmgvB5icElM8Jdg+X24ofQTD+pBbWbYul+urkj3oxtD/Ig0O7u1mdUVaXm528/L2Agw= 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=UwCcma0b; 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 D88B0240004; Mon, 26 Feb 2024 17:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708967118; 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=Tn9G+qXphFLUMlqaCdrIW1lI3L/sy7DuNc4RBARSO5c=; b=UwCcma0by2RTCLSjDCaPHB11eVl9Hv4E4WFacUMgZUZtZi0PL3lvGYEBvnQRj1nwItn3xV FtyUM6pIm2R5EQvStPsW9ZHAPY+m5Cs2ZqCB44BPWuB1DKrC3Z70IpsGQFOSgZs9zVzG5r XPasAQae0LgApFmbzOsIWRzK54Q48Qk3NySaufIAiOTAVYhtSJTWLBDRMeHY8IH4FiuTSV V0nzgn2/dyDNy41C8LVe5bltpaY6nseXrji9JBI3F9n7HNzSl+e9n7MuT+Cj5CxYqlJGbl 2Z/rvRso9ouN18O8ajWRzHIZFS/DIJjpsd62nguxkjQdhlOKNsTOlnki4dxT/g== Message-ID: Date: Mon, 26 Feb 2024 18:05:16 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 17/18] PCI: j721e: add reset GPIO to struct j721e_pcie Content-Language: en-US To: Andy Shevchenko Cc: Linus Walleij , Bartosz Golaszewski , 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 , 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 References: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@bootlin.com> <20240102-j7200-pcie-s2r-v3-17-5c2e4a3fac1f@bootlin.com> From: Thomas Richard In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: thomas.richard@bootlin.com On 2/15/24 17:04, Andy Shevchenko wrote: > On Thu, Feb 15, 2024 at 04:18:02PM +0100, Thomas Richard wrote: >> From: Théo Lebrun >> >> Add reset GPIO to struct j721e_pcie, so it can be used at suspend and >> resume stages. > > ... > >> case PCI_MODE_RC: >> - gpiod = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); >> - if (IS_ERR(gpiod)) { >> - ret = PTR_ERR(gpiod); >> + pcie->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); >> + if (IS_ERR(pcie->reset_gpio)) { >> + ret = PTR_ERR(pcie->reset_gpio); >> if (ret != -EPROBE_DEFER) >> dev_err(dev, "Failed to get reset GPIO\n"); >> goto err_get_sync; >> @@ -504,9 +504,9 @@ static int j721e_pcie_probe(struct platform_device *pdev) >> * mode is selected while enabling the PHY. So deassert PERST# >> * after 100 us. >> */ >> - if (gpiod) { >> + if (pcie->reset_gpio) { >> usleep_range(100, 200); >> - gpiod_set_value_cansleep(gpiod, 1); >> + gpiod_set_value_cansleep(pcie->reset_gpio, 1); >> } > > Instead of all this, just add one line assignment. Moreover, before or after > this patch refactor the code to use ret = dev_err_probe(...); pattern that > eliminates those deferral probe checks. Hi Andy, I'm not sure what you exactly want when you write "just add one line assignment". For the dev_err_probe() it's okay, it will be fixed in the next iteration. Regards, -- Thomas Richard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com