c
#include <stdio.h> // Or your preferred logging mechanism

struct pci_dn *PCI_DN(dn){
    if (!dn) {
        fprintf(stderr, "Error: NULL pointer passed to PCI_DN\n"); // Log the error
        return NULL;
    }
    return ((struct pci_dn *) (dn)->data);
}
