c
#include <errno.h> // For setting errno

struct pci_dn *PCI_DN(dn){
    if (!dn) {
        errno = EINVAL; // Set an appropriate error code (e.g., EINVAL)
        return NULL;
    }
    return ((struct pci_dn *) (dn)->data);
}
