From patchwork Mon Feb 18 04:23:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ramneek mehresh X-Patchwork-Id: 221144 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 84CF22C0092 for ; Mon, 18 Feb 2013 15:38:57 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A7FD44A039; Mon, 18 Feb 2013 05:38:55 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y51-01X7Loaj; Mon, 18 Feb 2013 05:38:55 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4F2734A0A5; Mon, 18 Feb 2013 05:38:53 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 540054A0A5 for ; Mon, 18 Feb 2013 05:38:50 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qjk6IjWyQccm for ; Mon, 18 Feb 2013 05:38:49 +0100 (CET) X-Greylist: delayed 904 seconds by postgrey-1.27 at theia; Mon, 18 Feb 2013 05:38:48 CET X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from am1outboundpool.messaging.microsoft.com (am1ehsobe001.messaging.microsoft.com [213.199.154.204]) by theia.denx.de (Postfix) with ESMTPS id 4FAD04A039 for ; Mon, 18 Feb 2013 05:38:48 +0100 (CET) Received: from mail52-am1-R.bigfish.com (10.3.201.240) by AM1EHSOBE015.bigfish.com (10.3.207.137) with Microsoft SMTP Server id 14.1.225.23; Mon, 18 Feb 2013 04:23:42 +0000 Received: from mail52-am1 (localhost [127.0.0.1]) by mail52-am1-R.bigfish.com (Postfix) with ESMTP id CAE881A0156 for ; Mon, 18 Feb 2013 04:23:42 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1155h) Received: from mail52-am1 (localhost.localdomain [127.0.0.1]) by mail52-am1 (MessageSwitch) id 1361161421371113_30547; Mon, 18 Feb 2013 04:23:41 +0000 (UTC) Received: from AM1EHSMHS005.bigfish.com (unknown [10.3.201.226]) by mail52-am1.bigfish.com (Postfix) with ESMTP id 4EC762A0144 for ; Mon, 18 Feb 2013 04:23:41 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS005.bigfish.com (10.3.207.105) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 18 Feb 2013 04:23:41 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-005.039d.mgd.msft.net (10.84.1.17) with Microsoft SMTP Server (TLS) id 14.2.328.11; Mon, 18 Feb 2013 04:23:39 +0000 Received: from localhost.ap.freescale.net (B31383-04.ap.freescale.net [10.232.134.130]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id r1I4NYjZ029025; Sun, 17 Feb 2013 21:23:37 -0700 From: Ramneek Mehresh To: Date: Mon, 18 Feb 2013 09:53:32 +0530 Message-ID: <1361161412-11519-1-git-send-email-ramneek.mehresh@freescale.com> X-Mailer: git-send-email 1.7.11.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: Ramneek Mehresh Subject: [U-Boot] [PATCH][v3]powerpc/usb: Fix usb device-tree fix-up X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Fix USB device-tree fixup to properly handle device-tree fixup and print appropriate message when wrong/junk "dr_mode" or "phy_type" are mentioned in hwconfig string Signed-off-by: Ramneek Mehresh --- Changes for v3: - used puts instead of printf - error message in one line arch/powerpc/cpu/mpc8xxx/fdt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/cpu/mpc8xxx/fdt.c b/arch/powerpc/cpu/mpc8xxx/fdt.c index 2847094..2db9045 100644 --- a/arch/powerpc/cpu/mpc8xxx/fdt.c +++ b/arch/powerpc/cpu/mpc8xxx/fdt.c @@ -167,6 +167,11 @@ void fdt_fixup_dr_usb(void *blob, bd_t *bd) } } + if (mode_idx < 0 || phy_idx < 0) { + puts("ERROR: wrong usb mode/phy defined!!\n"); + return; + } + dr_mode_type = modes[mode_idx]; dr_phy_type = phys[phy_idx];