From patchwork Mon Oct 17 13:18:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 77744 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp390601qge; Mon, 17 Oct 2016 06:16:21 -0700 (PDT) X-Received: by 10.28.111.134 with SMTP id c6mr8922260wmi.44.1476710180991; Mon, 17 Oct 2016 06:16:20 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id ge9si8280006wjd.123.2016.10.17.06.16.20; Mon, 17 Oct 2016 06:16:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1BAB5A75CC; Mon, 17 Oct 2016 15:16:05 +0200 (CEST) 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 gClAJDom2KWu; Mon, 17 Oct 2016 15:16:05 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EC69CB3857; Mon, 17 Oct 2016 15:15:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CE386A75BC for ; Mon, 17 Oct 2016 15:15:43 +0200 (CEST) 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 It4VnFtKUuz5 for ; Mon, 17 Oct 2016 15:15:43 +0200 (CEST) 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 conuserg-12.nifty.com (conuserg-12.nifty.com [210.131.2.79]) by theia.denx.de (Postfix) with ESMTPS id 23246A759C for ; Mon, 17 Oct 2016 15:15:40 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id u9HDFWta028415; Mon, 17 Oct 2016 22:15:34 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com u9HDFWta028415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1476710134; bh=4rD+WXeBEQHdqNdwx03m8dkoxnc/S32YU+RSRfjhdtU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F1UFPNLiUWLfXKKJstQ0DoKPo8oq9fvM+ac7ACf9eBTIuLeG0Q99Z/zyT+q+mr+vR 0cZvbf3EFoe5Fj1BG9+KoJYxgrRuA1rCslPAOz82PXfJTxjqi8/nQQ9l2RTxI8TkRM baZHCnOy8PalCg5cONpBtRCyPFMv/dYugkhRe6GPMJ5yNHF7zjXXtnAGTMp70u/Cg3 OJcyMlV+UbtvIMYiCOfubbHvpjJunHvTrz9hM2i28g+VO+7jegEZ+EgVvB0rDJf0qr VokXe/bfWsiLb/h2lpagwCZ3KiNqYaYGVBmURCVzGHiccN6aTRFo32oO2kg4AoOC7m bW28FiyjJIq9A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 17 Oct 2016 22:18:02 +0900 Message-Id: <1476710283-19586-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476710283-19586-1-git-send-email-yamada.masahiro@socionext.com> References: <1476710283-19586-1-git-send-email-yamada.masahiro@socionext.com> Cc: Albert Aribaud Subject: [U-Boot] [PATCH 2/3] ARM: uniphier: adjust fdt_file environment handling to latest Linux X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The environment fdt_file is useful to remember the appropriate DTB file name. Adjust it to the recent renaming in the upstream kernel. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/board_late_init.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/arch/arm/mach-uniphier/board_late_init.c b/arch/arm/mach-uniphier/board_late_init.c index f23295f..a63b19d 100644 --- a/arch/arm/mach-uniphier/board_late_init.c +++ b/arch/arm/mach-uniphier/board_late_init.c @@ -28,15 +28,12 @@ static void nand_denali_wp_disable(void) #endif } -#define VENDOR_PREFIX "socionext," -#define DTB_FILE_PREFIX "uniphier-" - static int uniphier_set_fdt_file(void) { DECLARE_GLOBAL_DATA_PTR; const char *compat; char dtb_name[256]; - int buf_len = 256; + int buf_len = sizeof(dtb_name); if (getenv("fdt_file")) return 0; /* do nothing if it is already set */ @@ -45,15 +42,13 @@ static int uniphier_set_fdt_file(void) if (!compat) return -EINVAL; - if (strncmp(compat, VENDOR_PREFIX, strlen(VENDOR_PREFIX))) + /* rip off the vendor prefix "socionext," */ + compat = strchr(compat, ','); + if (!compat) return -EINVAL; + compat++; - compat += strlen(VENDOR_PREFIX); - - strncat(dtb_name, DTB_FILE_PREFIX, buf_len); - buf_len -= strlen(DTB_FILE_PREFIX); - - strncat(dtb_name, compat, buf_len); + strncpy(dtb_name, compat, buf_len); buf_len -= strlen(compat); strncat(dtb_name, ".dtb", buf_len);