From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mateusz Zalega Date: Thu, 05 Sep 2013 19:37:43 +0200 Subject: [U-Boot] [PATCH v3] usb: new board-specific USB init interface In-Reply-To: <201309051750.20770.marex@denx.de> References: <1375786242-11734-1-git-send-email-m.zalega@samsung.com> <1378204870-25884-1-git-send-email-m.zalega@samsung.com> <201309051750.20770.marex@denx.de> Message-ID: <5228C167.3020804@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09/05/13 17:50, Marek Vasut wrote: >> v3 changes: >> - added 'index' argument to perform selective port initialization > > OK, a few general ideas again: > > Why not wrap board_usb_init() and board_usb_init_fail() into single call. You > now pass some flags to board_usb_init() already, so just add another for the > fail case. How does it sound to you? Like overengineering. It would lead to "board_usb_init(USB_INIT_ALL, USB_INIT_DEVICE, USB_CLEANUP)" calls, which are not very readable. > Moreover, the 'int index' should likely be unsigned int and the special value to > init all controllers at once should probably then be 0xffffffff Despite our greatest ambitions, I don't think we're likely to use more than 2^31-1 USB controllers at a time. Besides, negative values look better both in code and debugger session. Best Regards, -- Mateusz Zalega Samsung R&D Institute Poland