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

On 24 Apr 2003, Benjamin Herrenschmidt wrote:

> 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.

It seems PCI HWIFs are already doing this in ide_pci_setup_ports().

For me patch is okay.

--
Bartlomiej

> --- 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.021 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site