dev->pdev->pc = pa->pa_pc;
dev->pdev->tag = pa->pa_tag;
dev->pdev->pci = (struct pci_softc *)parent->dv_parent;
+ dev->pdev->_dev = parent;
#ifdef CONFIG_ACPI
dev->pdev->dev.node = acpi_find_pci(pa->pa_pc, pa->pa_tag);
-/* $OpenBSD: pci.h,v 1.17 2024/08/16 10:46:46 kettenis Exp $ */
+/* $OpenBSD: pci.h,v 1.18 2024/08/28 04:55:45 jsg Exp $ */
/*
* Copyright (c) 2015 Mark Kettenis
*
#include <linux/kobject.h>
#include <linux/dma-mapping.h>
#include <linux/mod_devicetable.h>
+#include <linux/device.h>
struct pci_dev;
uint8_t ltr_path;
struct pci_acpi dev;
+ struct device *_dev;
};
#define PCI_ANY_ID (uint16_t) (~0U)
static inline void
pci_set_drvdata(struct pci_dev *pdev, void *data)
{
+ dev_set_drvdata(pdev->_dev, data);
+}
+
+static inline void *
+pci_get_drvdata(struct pci_dev *pdev)
+{
+ return dev_get_drvdata(pdev->_dev);
}
static inline int