In the case of DRM drivers, the passed device is a child of vgapci and has a devclass of drmn. We want to start the lookup from vgapci, so the parent of the passed drmn.
This fixes an infinite loop with the amdgpu DRM driver that started to use this function in Linux 6.8: pci_upstream_bridge() was returning itself and the code in amdgpu was calling it again, hoping to get a device with a vendor that is not "ATI".
This is part of the update of DRM drivers to Linux 6.8.
Sponsored by: The FreeBSD Foundation