From: Luka Perkov Date: Mon, 14 May 2012 09:29:10 +0000 (+0000) Subject: ide: Correct IDE_BUS(dev) macro X-Git-Tag: v2012.10-rc3~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8a10180d62bb50a1f19441494bf9a5cea29ccfda;p=oweals%2Fu-boot.git ide: Correct IDE_BUS(dev) macro The IDE_BUS(dev) macro was previously doing dev >> 1. This however is a mis-match of the usage in common/cmd_ide.c and would cause boards with multiple ports / devices to not correctly detect all devices. For more details please see: http://lists.denx.de/pipermail/u-boot/2012-April/122525.html [Tom Rini: Reword commit message only] Tested-by: Luka Perkov Signed-off-by: Simon Baatz Signed-off-by: Tom Rini --- diff --git a/include/ide.h b/include/ide.h index 8ecc9dd3a5..385e9098c6 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)])