ide: fix hwif_to_node()

hwif_to_node() incorrectly assumes that hwif->dev always belongs to
a PCI device.  This results in ide-cs oopsing in init_irq() after
commit c56c5648 accidentally fixed
device tree registration for ide-cs.  Fix it by using dev_to_node().

Thanks to Martin Michlmayr and Larry Finger for help with debugging
the issue.
Reported-by: default avatarMartin Michlmayr <>
Tested-by: default avatarMartin Michlmayr <>
Cc: Larry Finger <>
Cc: Dominik Brodowski <>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <>
parent a1aee862
......@@ -1448,8 +1448,7 @@ static inline void ide_dump_identify(u8 *id)
static inline int hwif_to_node(ide_hwif_t *hwif)
struct pci_dev *dev = to_pci_dev(hwif->dev);
return hwif->dev ? pcibus_to_node(dev->bus) : -1;
return hwif->dev ? dev_to_node(hwif->dev) : -1;
static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment