summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/ide.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/ide.h b/include/ide.h
index 8ecc9dd3a53..385e9098c67 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -24,7 +24,7 @@
#ifndef _IDE_H
#define _IDE_H
-#define IDE_BUS(dev) (dev >> 1)
+#define IDE_BUS(dev) (dev / (CONFIG_SYS_IDE_MAXDEVICE / CONFIG_SYS_IDE_MAXBUS))
#define ATA_CURR_BASE(dev) (CONFIG_SYS_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)])