Skip to content

Commit

Permalink
ide: fix hwif_to_node()
Browse files Browse the repository at this point in the history
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 c56c564 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: Martin Michlmayr <tbm@cyrius.com>
Tested-by: Martin Michlmayr <tbm@cyrius.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Sep 2, 2008
1 parent a1aee86 commit 96f8021
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 96f8021

Please sign in to comment.