[U-Boot] [PATCH 1/3 V2] EHCI: Exynos: Add fdt support
Simon Glass
sjg at chromium.org
Thu Dec 6 18:57:55 CET 2012
Hi Marek,
On Thu, Dec 6, 2012 at 9:39 AM, Marek Vasut <marex at denx.de> wrote:
> Dear Rajeshwari Shinde,
>
>> Adding fdt support to ehci-exynos in order to parse
>> register base addresses from the device node.
>>
>> Signed-off-by: Vivek Gautam <gautam.vivek at samsung.com>
>> Signed-off-by: Rajeshwari Shinde <rajeshwari.s at samsung.com>
>> ---
>> Chnages in V2:
>> - Removed checkpatch errors.
>> drivers/usb/host/ehci-exynos.c | 59
>> ++++++++++++++++++++++++++++++++++++--- 1 files changed, 54 insertions(+),
>> 5 deletions(-)
>>
>> diff --git a/drivers/usb/host/ehci-exynos.c
>> b/drivers/usb/host/ehci-exynos.c index 9f0ed06..f9189a5 100644
>> --- a/drivers/usb/host/ehci-exynos.c
>> +++ b/drivers/usb/host/ehci-exynos.c
>> @@ -21,6 +21,8 @@
>> */
>>
>> #include <common.h>
>> +#include <fdtdec.h>
>> +#include <libfdt.h>
>> #include <usb.h>
>> #include <asm/arch/cpu.h>
>> #include <asm/arch/ehci.h>
>> @@ -28,6 +30,9 @@
>> #include <asm/arch/power.h>
>> #include "ehci.h"
>>
>> +/* Declare global data pointer */
>> +DECLARE_GLOBAL_DATA_PTR;
>> +
>> /* Setup the EHCI host controller. */
>> static void setup_usb_phy(struct exynos_usb_phy *usb)
>> {
>> @@ -86,12 +91,39 @@ static void reset_usb_phy(struct exynos_usb_phy *usb)
>> */
>> int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor
>> **hcor) {
>> - struct exynos_usb_phy *usb;
>> + struct exynos_usb_phy *usb = NULL;
>> + unsigned int *hcd = NULL;
>> + unsigned int node;
>> +
>> + node = fdtdec_next_compatible(gd->fdt_blob, 0,
>> + COMPAT_SAMSUNG_EXYNOS_EHCI);
>> + if (node <= 0) {
>> + debug("EHCI: Can't get device tree node for ehci\n");
> [...]
>
> error output should be really puts() or printf() ...
Ick that bloats the code badly for an uncommon case. Would really
prefer to avoid this.
>
> You can also use errno.h instead of -1.
True, it might help debugging, although many times it is hard to map
the error onto a suitable number designed for Linux. This 'return -1'
is pretty common in U-Boot (generic error).
>
> Rest is good
Regards,
Simon
More information about the U-Boot
mailing list