Message ID | 20180730154657.20738-28-miquel.raynal@bootlin.com |
---|---|
State | Accepted |
Delegated to: | Jagannadha Sutradharudu Teki |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41fPXV3cJcz9s0R for <incoming@patchwork.ozlabs.org>; Tue, 31 Jul 2018 02:04:42 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 27FA9C22018; Mon, 30 Jul 2018 15:59:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=KHOP_BIG_TO_CC autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B5D5DC220A8; Mon, 30 Jul 2018 15:48:17 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E39D7C2207E; Mon, 30 Jul 2018 15:47:44 +0000 (UTC) Received: from mail.bootlin.com (mail.bootlin.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 441F1C22042 for <u-boot@lists.denx.de>; Mon, 30 Jul 2018 15:47:31 +0000 (UTC) Received: by mail.bootlin.com (Postfix, from userid 110) id F38882097A; Mon, 30 Jul 2018 17:47:29 +0200 (CEST) Received: from localhost.localdomain (AAubervilliers-681-1-89-120.w90-88.abo.wanadoo.fr [90.88.30.120]) by mail.bootlin.com (Postfix) with ESMTPSA id 4F050209A4; Mon, 30 Jul 2018 17:47:07 +0200 (CEST) From: Miquel Raynal <miquel.raynal@bootlin.com> To: Tom Rini <trini@konsulko.com>, Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Date: Mon, 30 Jul 2018 17:46:57 +0200 Message-Id: <20180730154657.20738-28-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180730154657.20738-1-miquel.raynal@bootlin.com> References: <20180730154657.20738-1-miquel.raynal@bootlin.com> Cc: Scott Wood <oss@buserror.net>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Boris Brezillon <boris.brezillon@bootlin.com>, Antoine Tenart <antoine.tenart@bootlin.com>, Allan Nielsen <allan.nielsen@microsemi.com>, u-boot@lists.denx.de, Miquel Raynal <miquel.raynal@bootlin.com>, Stefan Roese <sr@denx.de>, Jagan Teki <jagan@openedev.com> Subject: [U-Boot] [PATCH v5 27/27] cmd: mtdparts: try to probe the MTD devices as a fallback X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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: <http://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> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> |
Series |
SPI-NAND support
|
expand
|
diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c index ef8588bd71..76f0138e4d 100644 --- a/cmd/mtdparts.c +++ b/cmd/mtdparts.c @@ -305,9 +305,15 @@ static int get_mtd_info(u8 type, u8 num, struct mtd_info **mtd) sprintf(mtd_dev, "%s%d", MTD_DEV_TYPE(type), num); *mtd = get_mtd_device_nm(mtd_dev); - if (IS_ERR(*mtd)) { - printf("Device %s not found!\n", mtd_dev); - return 1; + if (IS_ERR_OR_NULL(*mtd)) { +#ifdef CONFIG_CMD_MTD + mtd_probe_devices(); + *mtd = get_mtd_device_nm(mtd_dev); +#endif + if (IS_ERR_OR_NULL(*mtd)) { + printf("Device %s not found!\n", mtd_dev); + return 1; + } } put_mtd_device(*mtd);