lkml.org 
[lkml]   [2003]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] Let ide interfaces choose a parent device
From
Date
Hi !

Right now, the parent struct device of IDE interfaces is forced to be
either the pci_dev or some not-yet implemented legacy node. This is
wrong as non-PCI ide interfaces may well hang off different bus types.
For PowerMac, for example, I'm defining a bus type for Apple's "MacIO"
ASIC and ide/ppc/pmac.c will hang off a device on that bus.

The following patch will let the HWIF fill the parent pointer and only
put it's "default" stuff in there if it's NULL.


--- 1.40/drivers/ide/ide-probe.c Fri Apr 18 17:58:55 2003
+++ edited/drivers/ide/ide-probe.c Thu Apr 24 15:15:15 2003
@@ -696,10 +696,12 @@
strncpy(hwif->gendev.bus_id,hwif->name,BUS_ID_SIZE);
snprintf(hwif->gendev.name,DEVICE_NAME_SIZE,"IDE Controller");
hwif->gendev.driver_data = hwif;
- if (hwif->pci_dev)
- hwif->gendev.parent = &hwif->pci_dev->dev;
- else
- hwif->gendev.parent = NULL; /* Would like to do = &device_legacy */
+ if (hwif->gendev.parent == NULL) {
+ if (hwif->pci_dev)
+ hwif->gendev.parent = &hwif->pci_dev->dev;
+ else
+ hwif->gendev.parent = NULL; /* Would like to do = &device_legacy */
+ }
device_register(&hwif->gendev);

if (hwif->mmio == 2)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.022 / U:1.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site