PCI: cadence: Check for the existence of cdns_pcie::ops before using it

[ Upstream commit 49a6c160ad ]

cdns_pcie::ops might not be populated by all the Cadence glue drivers. This
is going to be true for the upcoming Sophgo platform which doesn't set the
ops.

Hence, add a check to prevent NULL pointer dereference.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
[mani: reworded subject and description]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/35182ee1d972dfcd093a964e11205efcebbdc044.1757643388.git.unicorn_wang@outlook.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Chen Wang 2025-09-12 10:36:01 +08:00 • committed by Greg Kroah-Hartman
commit eb3d29ca08
3 changed files with 6 additions and 6 deletions