Message ID | 20231228153922.84323-3-avromanov@salutedevices.com |
---|---|
State | Superseded |
Delegated to: | Dario Binacchi |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=salutedevices.com header.i=@salutedevices.com header.a=rsa-sha256 header.s=mail header.b=WWVmLHbK; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T1CQt3ml8z20Rq for <incoming@patchwork.ozlabs.org>; Fri, 29 Dec 2023 02:41:10 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 550C287AC4; Thu, 28 Dec 2023 16:40:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=salutedevices.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=salutedevices.com header.i=@salutedevices.com header.b="WWVmLHbK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6AC1987A89; Thu, 28 Dec 2023 16:39:36 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E103287AB3 for <u-boot@lists.denx.de>; Thu, 28 Dec 2023 16:39:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=salutedevices.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=avromanov@salutedevices.com Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 32A48120010; Thu, 28 Dec 2023 18:39:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 32A48120010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1703777972; bh=nQVazzsrYptWgEBwPT1HKrCJzo6viMcQok7ToIvuCW8=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=WWVmLHbKnsN8f8RkntHnYINXWJ91L9VUZ/1BuM1doues/DSFQjZQOBfE6Oc4OBLT8 gRrZpfF3WPSzj7Z5UJK4rHrNCNsZ1kGKJnKKFooLCyJk9wxVu7zVMSrnOgVN4+/K1m yO7eTWqqgURzQTASOH5kaGAItvpJLM2bmrY5ClkSak8AiayEoseYTSh43Jjt9tRBWX rzbxEo/yLBdvshKShlYfbXu4llvleRK5mOj9RWH4vFewuh8dr15U31BtmyEqptwRd0 Ee1rV4gaPo0wEg2Z2S5DMsQUOukBkB5UOOjKNYPdMq3g5iIUoU4JAs7WSKSBvShVG6 DbbgaW6nLLgeg== Received: from smtp.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Thu, 28 Dec 2023 18:39:32 +0300 (MSK) Received: from cab-wsm-0029881.sberdevices.ru (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 28 Dec 2023 18:39:31 +0300 From: Alexey Romanov <avromanov@salutedevices.com> To: <michal.simek@amd.com>, <marex@denx.de>, <michael@walle.cc>, <stcarlso@linux.microsoft.com>, <tobias@waldekranz.com>, <seanedmond@microsoft.com>, <abdellatif.elkhlifi@arm.com>, <neil.armstrong@linaro.org>, <n-jain1@ti.com>, <xypron.glpk@gmx.de>, <dario.binacchi@amarulasolutions.com>, <michael@amarulasolutions.com>, <frieder.schrempf@kontron.de>, <sjg@chromium.org>, <hs@denx.de>, <sean.anderson@seco.com>, <dimorinny@google.com>, <mkorpershoek@baylibre.com>, <patrick.delaunay@foss.st.com> CC: <u-boot@lists.denx.de>, <kernel@salutedevices.com>, Alexey Romanov <avromanov@salutedevices.com> Subject: [PATCH v1 02/12] nand: don't overwrite mtd name in nand_register() Date: Thu, 28 Dec 2023 18:39:05 +0300 Message-ID: <20231228153922.84323-3-avromanov@salutedevices.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231228153922.84323-1-avromanov@salutedevices.com> References: <20231228153922.84323-1-avromanov@salutedevices.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 182415 [Dec 28 2023] X-KSMG-AntiSpam-Version: 6.1.0.3 X-KSMG-AntiSpam-Envelope-From: avromanov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 7 0.3.7 6d6bf5bd8eea7373134f756a2fd73e9456bb7d1a, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2; d41d8cd98f00b204e9800998ecf8427e.com:7.1.1; smtp.sberdevices.ru:7.1.1,5.0.1; 127.0.0.199:7.1.2; salutedevices.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/12/28 11:18:00 #22863388 X-KSMG-AntiVirus-Status: Clean, skipped X-Mailman-Approved-At: Thu, 28 Dec 2023 16:40:43 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean |
Series |
Support SPI NAND in fastboot protocol
|
expand
|
diff --git a/drivers/mtd/nand/core.c b/drivers/mtd/nand/core.c index ff298e3a0f..5a63e74ccb 100644 --- a/drivers/mtd/nand/core.c +++ b/drivers/mtd/nand/core.c @@ -22,7 +22,7 @@ int nand_curr_device = -1; static struct mtd_info *nand_info[CONFIG_SYS_MAX_NAND_DEVICE]; -static char dev_name[CONFIG_SYS_MAX_NAND_DEVICE][8]; +static char dev_name[CONFIG_SYS_MAX_NAND_DEVICE][16]; static unsigned long total_nand_size; /* in kiB */ /** @@ -288,8 +288,12 @@ int nand_register(int devnum, struct mtd_info *mtd) nand_info[devnum] = mtd; - sprintf(dev_name[devnum], "nand%d", devnum); - mtd->name = dev_name[devnum]; + if (!strlen(mtd->name)) { + snprintf(dev_name[devnum], ARRAY_SIZE(dev_name[devnum]), "nand%d", devnum); + mtd->name = dev_name[devnum]; + } else { + strlcpy(dev_name[devnum], mtd->name, ARRAY_SIZE(dev_name[devnum])); + } #ifdef CONFIG_MTD /*
We use this function in SPI NAND subsystem, which already filled mtd->name field with "spi-nand0" string. Signed-off-by: Alexey Romanov <avromanov@salutedevices.com> --- drivers/mtd/nand/core.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)