Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/linux Define pci_get/set_drvdata prope...
details: https://anonhg.NetBSD.org/src/rev/06d36b045201
branches: trunk
changeset: 1027955:06d36b045201
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 01:21:15 2021 +0000
description:
Define pci_get/set_drvdata properly.
diffstat:
sys/external/bsd/drm2/include/linux/pci.h | 9 +++++----
sys/external/bsd/drm2/linux/linux_pci.c | 17 +++++++++++------
2 files changed, 16 insertions(+), 10 deletions(-)
diffs (84 lines):
diff -r 9143b50d2ebd -r 06d36b045201 sys/external/bsd/drm2/include/linux/pci.h
--- a/sys/external/bsd/drm2/include/linux/pci.h Sun Dec 19 01:21:08 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/pci.h Sun Dec 19 01:21:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci.h,v 1.41 2021/12/19 01:21:08 riastradh Exp $ */
+/* $NetBSD: pci.h,v 1.42 2021/12/19 01:21:15 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -150,7 +150,7 @@
bus_size_t pd_rom_found_size;
void *pd_rom_vaddr;
device_t pd_dev;
- struct drm_device *pd_drm_dev; /* XXX Nouveau kludge! */
+ void *pd_drvdata;
struct {
pcireg_t type;
bus_addr_t addr;
@@ -219,6 +219,7 @@
#define pci_resource_start linux_pci_resource_start
#define pci_restore_state linux_pci_restore_state
#define pci_save_state linux_pci_save_state
+#define pci_set_drvdata linux_pci_set_drvdata
#define pci_set_master linux_pci_set_master
#define pci_unmap_rom linux_pci_unmap_rom
#define pci_write_config_byte linux_pci_write_config_byte
@@ -239,8 +240,8 @@
int pci_domain_nr(struct pci_bus *);
device_t pci_dev_dev(struct pci_dev *);
-struct drm_device * /* XXX Nouveau kludge! */
- pci_get_drvdata(struct pci_dev *);
+void pci_set_drvdata(struct pci_dev *, void *);
+void * pci_get_drvdata(struct pci_dev *);
int pci_find_capability(struct pci_dev *, int);
bool pci_is_pcie(struct pci_dev *);
diff -r 9143b50d2ebd -r 06d36b045201 sys/external/bsd/drm2/linux/linux_pci.c
--- a/sys/external/bsd/drm2/linux/linux_pci.c Sun Dec 19 01:21:08 2021 +0000
+++ b/sys/external/bsd/drm2/linux/linux_pci.c Sun Dec 19 01:21:15 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_pci.c,v 1.11 2021/12/19 01:21:08 riastradh Exp $ */
+/* $NetBSD: linux_pci.c,v 1.12 2021/12/19 01:21:15 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.11 2021/12/19 01:21:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.12 2021/12/19 01:21:15 riastradh Exp $");
#include <linux/pci.h>
@@ -47,12 +47,16 @@
return pdev->pd_dev;
}
-/* XXX Nouveau kludge! */
-struct drm_device *
+void
+pci_set_drvdata(struct pci_dev *pdev, void *drvdata)
+{
+ pdev->pd_drvdata = drvdata;
+}
+
+void *
pci_get_drvdata(struct pci_dev *pdev)
{
-
- return pdev->pd_drm_dev;
+ return pdev->pd_drvdata;
}
void
@@ -82,6 +86,7 @@
#endif
pdev->pd_saved_state = NULL;
pdev->pd_intr_handles = NULL;
+ pdev->pd_drvdata = NULL;
pdev->bus = kmem_zalloc(sizeof(*pdev->bus), KM_NOSLEEP);
pdev->bus->pb_pc = pa->pa_pc;
pdev->bus->pb_dev = parent;
Home |
Main Index |
Thread Index |
Old Index