From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>,
Linus Torvalds <torvalds@transmeta.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
linux-kernel mailing list <linux-kernel@vger.kernel.org>
Subject: [PATCH] Let ide interfaces choose a parent device
Date: 24 Apr 2003 15:22:51 +0200 [thread overview]
Message-ID: <1051190571.12880.32.camel@gaston> (raw)
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)
next reply other threads:[~2003-04-24 13:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-24 13:22 Benjamin Herrenschmidt [this message]
2003-04-24 15:14 ` [PATCH] Let ide interfaces choose a parent device Bartlomiej Zolnierkiewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1051190571.12880.32.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=B.Zolnierkiewicz@elka.pw.edu.pl \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.