linuxkpi: Move lkpi_pcim_iomap_devres_find to .c file
lkpi_pcim_iomap_devres_find encodes the size of struct pcim_iomap_devres in the code, so move from .h to .c to move from client driver to linuxkpi module. Sponsored by: Netflix Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D34775
This commit is contained in:
parent
36b5c44002
commit
2bf3361d56
@ -325,6 +325,7 @@ struct pci_dev *lkpinew_pci_dev(device_t);
|
|||||||
struct pci_devres *lkpi_pci_devres_get_alloc(struct pci_dev *pdev);
|
struct pci_devres *lkpi_pci_devres_get_alloc(struct pci_dev *pdev);
|
||||||
void lkpi_pci_devres_release(struct device *, void *);
|
void lkpi_pci_devres_release(struct device *, void *);
|
||||||
struct resource *_lkpi_pci_iomap(struct pci_dev *pdev, int bar, int mmio_size);
|
struct resource *_lkpi_pci_iomap(struct pci_dev *pdev, int bar, int mmio_size);
|
||||||
|
struct pcim_iomap_devres *lkpi_pcim_iomap_devres_find(struct pci_dev *pdev);
|
||||||
void lkpi_pcim_iomap_table_release(struct device *, void *);
|
void lkpi_pcim_iomap_table_release(struct device *, void *);
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
@ -1409,26 +1410,6 @@ pcim_enable_device(struct pci_dev *pdev)
|
|||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct pcim_iomap_devres *
|
|
||||||
lkpi_pcim_iomap_devres_find(struct pci_dev *pdev)
|
|
||||||
{
|
|
||||||
struct pcim_iomap_devres *dr;
|
|
||||||
|
|
||||||
dr = lkpi_devres_find(&pdev->dev, lkpi_pcim_iomap_table_release,
|
|
||||||
NULL, NULL);
|
|
||||||
if (dr == NULL) {
|
|
||||||
dr = lkpi_devres_alloc(lkpi_pcim_iomap_table_release,
|
|
||||||
sizeof(*dr), GFP_KERNEL | __GFP_ZERO);
|
|
||||||
if (dr != NULL)
|
|
||||||
lkpi_devres_add(&pdev->dev, dr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dr == NULL)
|
|
||||||
device_printf(pdev->dev.bsddev, "%s: NULL\n", __func__);
|
|
||||||
|
|
||||||
return (dr);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void __iomem **
|
static inline void __iomem **
|
||||||
pcim_iomap_table(struct pci_dev *pdev)
|
pcim_iomap_table(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
|
@ -553,6 +553,26 @@ lkpi_pci_devres_release(struct device *dev, void *p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct pcim_iomap_devres *
|
||||||
|
lkpi_pcim_iomap_devres_find(struct pci_dev *pdev)
|
||||||
|
{
|
||||||
|
struct pcim_iomap_devres *dr;
|
||||||
|
|
||||||
|
dr = lkpi_devres_find(&pdev->dev, lkpi_pcim_iomap_table_release,
|
||||||
|
NULL, NULL);
|
||||||
|
if (dr == NULL) {
|
||||||
|
dr = lkpi_devres_alloc(lkpi_pcim_iomap_table_release,
|
||||||
|
sizeof(*dr), GFP_KERNEL | __GFP_ZERO);
|
||||||
|
if (dr != NULL)
|
||||||
|
lkpi_devres_add(&pdev->dev, dr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dr == NULL)
|
||||||
|
device_printf(pdev->dev.bsddev, "%s: NULL\n", __func__);
|
||||||
|
|
||||||
|
return (dr);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
lkpi_pcim_iomap_table_release(struct device *dev, void *p)
|
lkpi_pcim_iomap_table_release(struct device *dev, void *p)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user