Module Name:    src
Committed By:   riastradh
Date:           Wed Jul 24 03:18:24 UTC 2013

Modified Files:
        src/sys/external/bsd/drm2/include/linux [riastradh-drm2]: pci.h

Log Message:
Fix struct pci_dev::dev in <linux/pci.h>.

Linux code expects it to be a struct device and takes its address,
but we can't arrange for the actual struct device to go there.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 \
    src/sys/external/bsd/drm2/include/linux/pci.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/pci.h
diff -u src/sys/external/bsd/drm2/include/linux/pci.h:1.1.2.10 src/sys/external/bsd/drm2/include/linux/pci.h:1.1.2.11
--- src/sys/external/bsd/drm2/include/linux/pci.h:1.1.2.10	Wed Jul 24 03:16:47 2013
+++ src/sys/external/bsd/drm2/include/linux/pci.h	Wed Jul 24 03:18:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci.h,v 1.1.2.10 2013/07/24 03:16:47 riastradh Exp $	*/
+/*	$NetBSD: pci.h,v 1.1.2.11 2013/07/24 03:18:24 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ struct pci_device_id {
 struct pci_dev {
 	struct pci_attach_args	pd_pa;
 	bool			pd_kludged;	/* XXX pci_kludgey_find_dev */
-	device_t		dev;
+	device_t		pd_dev;
 	struct pci_bus		*bus;
 	uint32_t		devfn;
 	uint16_t		vendor;
@@ -78,6 +78,12 @@ struct pci_dev {
 	bool 			msi_enabled;
 };
 
+static inline device_t
+pci_dev_dev(struct pci_dev *pdev)
+{
+	return pdev->pd_dev;
+}
+
 #define	PCI_DEVFN(DEV, FN)						\
 	(__SHIFTIN((DEV), __BITS(3, 7)) | __SHIFTIN((FN), __BITS(0, 2)))
 #define	PCI_SLOT(DEVFN)		__SHIFTOUT((DEVFN), __BITS(3, 7))

Reply via email to