From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Mon, 06 Sep 2010 19:15:20 +0200 Subject: [U-Boot] [PATCH] IDE: Don't assume there are always two devices per bus In-Reply-To: <20100906125039.26BDBB7164@gemini.denx.de> References: <20100815213046.A427B1606A5@gemini.denx.de> <1281937660-25632-2-git-send-email-user@aphrodite> <4C76691D.9070701@dawes.za.net> <4C8201CB.9080606@free.fr> <20100905221935.ACE1E1506AA@gemini.denx.de> <4C848200.7080401@free.fr> <20100906060557.793391506AA@gemini.denx.de> <4C848E1A.1070003@free.fr> <20100906081806.C2F9E153798@gemini.denx.de> <4C84D13C.8040702@free.fr> <20100906125039.26BDBB7164@gemini.denx.de> Message-ID: <4C8521A8.6050107@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Le 06/09/2010 14:50, Wolfgang Denk a ?crit : >> 2) as for ide_bus_offset[] and ide_dev_desc[], and any other existing >> array based on CONFIG_SYS_IDE_MAXBUS or CONFIG_SYS_IDE_MAXDEVICE, they >> are not going to grow any bigger with my proposal since neither config >> option will increase. > > We might chnage this to dynamically allocated structures. maybe that > would make more sense then? I don't see much benefit in allocating dynamically rather than statically unless you are really tight on RAM, which seems to not fit with a board which has many busses and disks. Plus, IDE may not know about hotplugging, but SATA does, which means I can do an ide_init(), plug or unplug disks, and do an ide_init() again with a different number of devices. Dynamic allocation requires resizing the allocated arrays; static is just less trouble. Anyway, static vs dynamic can be done in a second step after adding N busses (and thereby fixing the issue of ghost devices that prompted Rogan's patch proposal). Amicalement, -- Albert.