From: Bartlomiej Zolnierkiewicz Date: Tue, 2 Sep 2008 18:18:47 +0000 (+0200) Subject: ide: fix hwif_to_node() X-Git-Tag: v2.6.27-rc6~76^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=96f80219b738f84f90e449385bdede90f2910521;p=karo-tx-linux.git 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 c56c5648a3bd15ff14c50f284b261140cd5b5472 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 Tested-by: Martin Michlmayr Cc: Larry Finger Cc: Dominik Brodowski Signed-off-by: Bartlomiej Zolnierkiewicz --- diff --git a/include/linux/ide.h b/include/linux/ide.h index fee4b157c533..1524829f73f2 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -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)