public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] PCI: j721e: In j721e_pcie_suspend_noirq() check reset_gpio before to use it
@ 2024-12-09 11:23 Thomas Richard
  2024-12-09 11:26 ` Siddharth Vadapalli
  2024-12-10 15:42 ` Bjorn Helgaas
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Richard @ 2024-12-09 11:23 UTC (permalink / raw)
  To: vigneshr, s-vadapalli, lpieralisi, kw, manivannan.sadhasivam,
	robh, bhelgaas, theo.lebrun
  Cc: thomas.petazzoni, kwilczynski, linux-omap, linux-pci,
	linux-arm-kernel, linux-kernel, gregory.clement, u-kumar1,
	thomas.richard

The reset_gpio is optional, so in j721e_pcie_suspend_noirq() check if it is
not NULL before to use it.

Fixes: c538d40f365b ("PCI: j721e: Add suspend and resume support")
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
---
 drivers/pci/controller/cadence/pci-j721e.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c
index 0341d51d6aed..5bc14dd70811 100644
--- a/drivers/pci/controller/cadence/pci-j721e.c
+++ b/drivers/pci/controller/cadence/pci-j721e.c
@@ -644,7 +644,9 @@ static int j721e_pcie_suspend_noirq(struct device *dev)
 	struct j721e_pcie *pcie = dev_get_drvdata(dev);
 
 	if (pcie->mode == PCI_MODE_RC) {
-		gpiod_set_value_cansleep(pcie->reset_gpio, 0);
+		if (pcie->reset_gpio)
+			gpiod_set_value_cansleep(pcie->reset_gpio, 0);
+
 		clk_disable_unprepare(pcie->refclk);
 	}
 
-- 
2.39.5



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-12-11 20:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-09 11:23 [PATCH] PCI: j721e: In j721e_pcie_suspend_noirq() check reset_gpio before to use it Thomas Richard
2024-12-09 11:26 ` Siddharth Vadapalli
2024-12-10 15:42 ` Bjorn Helgaas
2024-12-11  8:59   ` Thomas Richard
2024-12-11  9:14     ` Manivannan Sadhasivam
2024-12-11 20:24       ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox