reprint device name in attach error paths if needed
authorjsg <jsg@openbsd.org>
Mon, 14 Feb 2022 05:30:53 +0000 (05:30 +0000)
committerjsg <jsg@openbsd.org>
Mon, 14 Feb 2022 05:30:53 +0000 (05:30 +0000)
sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c
sys/dev/pci/drm/radeon/radeon_kms.c

index 27db010..37245c5 100644 (file)
@@ -1891,13 +1891,15 @@ amdgpu_attach(struct device *parent, struct device *self, void *aux)
                drm_sched_fence_slab_init();
 
                if (amdgpu_sync_init()) {
-                       printf(": amdgpu_sync_init failed\n");
+                       printf("%s: amdgpu_sync_init failed\n",
+                           adev->self.dv_xname);
                        return;
                }
 
                if (amdgpu_fence_slab_init()) {
                        amdgpu_sync_fini();
-                       printf(": amdgpu_fence_slab_init failed\n");
+                       printf("%s: amdgpu_fence_slab_init failed\n",
+                           adev->self.dv_xname);
                        return;
                }
 
@@ -1910,7 +1912,7 @@ amdgpu_attach(struct device *parent, struct device *self, void *aux)
        if (pci_intr_map_msi(pa, &adev->intrh) == 0)
                adev->irq.msi_enabled = true;
        else if (pci_intr_map(pa, &adev->intrh) != 0) {
-               printf(": couldn't map interrupt\n");
+               printf("%s: couldn't map interrupt\n", adev->self.dv_xname);
                return;
        }
        printf("%s: %s\n", adev->self.dv_xname,
index 24c87b2..34c7a47 100644 (file)
@@ -670,7 +670,7 @@ radeondrm_attach_kms(struct device *parent, struct device *self, void *aux)
        if (pci_intr_map_msi(pa, &rdev->intrh) == 0)
                rdev->msi_enabled = 1;
        else if (pci_intr_map(pa, &rdev->intrh) != 0) {
-               printf(": couldn't map interrupt\n");
+               printf("%s: couldn't map interrupt\n", rdev->self.dv_xname);
                return;
        }
        printf("%s: %s\n", rdev->self.dv_xname,