From: François Tigeot Date: Tue, 5 Dec 2017 20:52:31 +0000 (+0100) Subject: drm/linux: Improve linux/pci.h X-Git-Tag: v5.3.0~722 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/59e561f580dddb57d32506d17e4fa762376dcbf8 drm/linux: Improve linux/pci.h * Add pci_get_drvdata and pci_set_drvdata() * Add pci_register_driver() --- diff --git a/sys/dev/drm/include/linux/pci.h b/sys/dev/drm/include/linux/pci.h index 3615d97072..5285d428f5 100644 --- a/sys/dev/drm/include/linux/pci.h +++ b/sys/dev/drm/include/linux/pci.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2017 François Tigeot + * Copyright (c) 2014-2017 François Tigeot * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -71,6 +71,7 @@ struct pci_dev { uint8_t revision; /* revision ID */ unsigned int irq; /* handle with care */ + void *pci_dev_data; }; struct pci_bus { @@ -80,6 +81,9 @@ struct pci_bus { unsigned char number; /* bus addr number */ }; +struct pci_driver { +}; + #define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) #define PCI_DMA_BIDIRECTIONAL 0 @@ -304,4 +308,22 @@ pci_bus_read_config_word(struct pci_bus *bus, unsigned int devfn, int where, u16 return 0; } +static inline void * +pci_get_drvdata(struct pci_dev *pdev) +{ + return pdev->pci_dev_data; +} + +static inline void +pci_set_drvdata(struct pci_dev *pdev, void *data) +{ + pdev->pci_dev_data = data; +} + +static inline int +pci_register_driver(struct pci_driver *drv) +{ + return 0; +} + #endif /* LINUX_PCI_H */