From c15a3837d2aa30e3ea41aed49d80abed355ab6bd Mon Sep 17 00:00:00 2001 From: David Brownell Date: Tue, 8 May 2007 00:27:35 -0700 Subject: parport->dev driver model support Currently a parport_driver can't get a handle on the device node for the underlying parport (PNPACPI, PCI, etc). That prevents correct placement of sysfs child nodes, which can affect things like power management. This patch adds a field to "struct parport" pointing to that device node, and updates non-legacy port drivers to initialize that device pointer. That field replaces the analagous PCI-only support in parport_pc. [akpm@linux-foundation.org: fix powerpc build] Signed-off-by: David Brownell Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-powerpc/parport.h | 5 ----- include/linux/parport.h | 8 ++++++-- include/linux/parport_pc.h | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/asm-powerpc/parport.h b/include/asm-powerpc/parport.h index b37b81e3727..414c50e2e88 100644 --- a/include/asm-powerpc/parport.h +++ b/include/asm-powerpc/parport.h @@ -12,11 +12,6 @@ #include -extern struct parport *parport_pc_probe_port (unsigned long int base, - unsigned long int base_hi, - int irq, int dma, - struct pci_dev *dev); - static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) { struct device_node *np; diff --git a/include/linux/parport.h b/include/linux/parport.h index 80682aaa8f1..9cdd6943e01 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -279,6 +279,10 @@ struct parport { int dma; int muxport; /* which muxport (if any) this is */ int portnum; /* which physical parallel port (not mux) */ + struct device *dev; /* Physical device associated with IO/DMA. + * This may unfortulately be null if the + * port has a legacy driver. + */ struct parport *physport; /* If this is a non-default mux @@ -289,7 +293,7 @@ struct parport { following structure members are meaningless: devices, cad, muxsel, waithead, waittail, flags, pdir, - ieee1284, *_lock. + dev, ieee1284, *_lock. It this is a default mux parport, or there is no mux involved, this points to @@ -302,7 +306,7 @@ struct parport { struct pardevice *waithead; struct pardevice *waittail; - + struct list_head list; unsigned int flags; diff --git a/include/linux/parport_pc.h b/include/linux/parport_pc.h index 1cc0f6b1a49..ea8c6d84996 100644 --- a/include/linux/parport_pc.h +++ b/include/linux/parport_pc.h @@ -38,7 +38,6 @@ struct parport_pc_private { /* buffer suitable for DMA, if DMA enabled */ char *dma_buf; dma_addr_t dma_handle; - struct pci_dev *dev; struct list_head list; struct parport *port; }; @@ -232,7 +231,7 @@ extern int parport_pc_claim_resources(struct parport *p); extern struct parport *parport_pc_probe_port (unsigned long base, unsigned long base_hi, int irq, int dma, - struct pci_dev *dev); + struct device *dev); extern void parport_pc_unregister_port (struct parport *p); #endif -- cgit v1.2.3