Re: [PATCH] IDE (& PowerMac): Let an hwif have a real parent

From: Bartlomiej Zolnierkiewicz
Date: Sun Aug 10 2003 - 09:37:49 EST



On 10 Aug 2003, Benjamin Herrenschmidt wrote:

> Hi Linus & Bart !
>
> This patch allows an IDE hwif to be set a "parent" field so it
> can really descend from any struct device, typically the macio_device
> I use on pmac, and not only a PCI device or the legacy stuff.
>
> This should work fine as long as hwif->gendev.parent doesn't
> contain junk, but so far, it seems it really only contains
> NULL unless specifically set by the host driver.
>
> Without that, the pmac driver will not appear in it's proper
> location in the device tree, which is a real problem for power
> management as it won't be ordered properly with it's hosting
> asic (and mediabay if any), thus breaking suspend/resume.

Looks good.

> Please apply,
> Ben.

Can you fix intendation, or I should do it?

> --- a/drivers/ide/ide-probe.c Sun Aug 10 16:07:40 2003
> +++ b/drivers/ide/ide-probe.c Sun Aug 10 16:07:40 2003
> @@ -650,10 +650,12 @@
> strlcpy(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->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);
> }

--bartlomiej

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