From patchwork Sat Nov 9 11:43:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caizhiyong X-Patchwork-Id: 289988 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 03BFE2C00AD for ; Sat, 9 Nov 2013 22:45:34 +1100 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vf6yc-0003Y5-3n; Sat, 09 Nov 2013 11:45:18 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vf6ya-0007xS-In; Sat, 09 Nov 2013 11:45:16 +0000 Received: from szxga01-in.huawei.com ([119.145.14.64]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vf6yV-0007wn-VJ for linux-mtd@lists.infradead.org; Sat, 09 Nov 2013 11:45:14 +0000 Received: from 172.24.2.119 (EHLO szxeml205-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BMJ54665; Sat, 09 Nov 2013 19:43:18 +0800 (CST) Received: from SZXEML424-HUB.china.huawei.com (10.82.67.163) by szxeml205-edg.china.huawei.com (172.24.2.58) with Microsoft SMTP Server (TLS) id 14.3.158.1; Sat, 9 Nov 2013 19:43:15 +0800 Received: from SZXEML512-MBS.china.huawei.com ([169.254.8.96]) by szxeml424-hub.china.huawei.com ([10.82.67.163]) with mapi id 14.03.0158.001; Sat, 9 Nov 2013 19:43:07 +0800 From: Caizhiyong To: Andrew Morton Subject: [PATCH 2/2] mtd: cmdlinepart: support master name is not set when parser partition Thread-Topic: [PATCH 2/2] mtd: cmdlinepart: support master name is not set when parser partition Thread-Index: Ac7dQNrmaepPFNCzTfSQ2Rn2iobZJg== Date: Sat, 9 Nov 2013 11:43:06 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.223.36] MIME-Version: 1.0 X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131109_064512_938442_39957A3D X-CRM114-Status: GOOD ( 13.21 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [119.145.14.64 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: "fengguang.wu@intel.com" , Brian Norris , Artem Bityutskiy , Randy Dunlap , "linux-kernel@vger.kernel.org" , Karel Zak , "linux-mtd@lists.infradead.org" , Shmulik Ladkani , "Wanglin \(Albert\)" X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Cai Zhiyong Date: Sat, 9 Nov 2013 17:54:12 +0800 Subject: [PATCH 2/2] mtd: cmdlinepart: support master name is not set when parser partition -Fix compile warning with value and function undeclared. this reported by and Randy Dunlap -support master name is not set when parser partition. this feature is supported in the old parser. Signed-off-by: Cai Zhiyong --- drivers/mtd/Kconfig | 1 + drivers/mtd/cmdlinepart.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index daf544a..f8f45e0 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig @@ -76,6 +76,7 @@ endif # MTD_REDBOOT_PARTS config MTD_CMDLINE_PARTS tristate "Command line partition table parsing" select BLK_CMDLINE_PARSER + depends on BLOCK depends on MTD ---help--- Allow generic configuration of the MTD partition tables via the kernel diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c index ba934a4..2074164 100644 --- a/drivers/mtd/cmdlinepart.c +++ b/drivers/mtd/cmdlinepart.c @@ -54,6 +54,7 @@ */ #include +#include #include #include #include @@ -108,7 +109,12 @@ static int parse_cmdline_partitions(struct mtd_info *master, if (!mtd_cmdline_parts) return 0; - parts = cmdline_parts_find(mtd_cmdline_parts, master->name); + /* If master->name is not set, return the first device partition. */ + if (!master->name) + parts = mtd_cmdline_parts->next_parts; + else + parts = cmdline_parts_find(mtd_cmdline_parts, master->name); + if (!parts) return 0; @@ -143,5 +149,5 @@ MODULE_PARM_DESC(mtdparts, "Partitioning specification"); module_param(mtdparts, charp, 0); MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Marius Groeger "); +MODULE_AUTHOR("Cai Zhiyong "); MODULE_DESCRIPTION("Command line configuration of MTD partitions");