From patchwork Mon Dec 5 15:08:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 129320 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B01801007D6 for ; Tue, 6 Dec 2011 02:11:01 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1RXaAU-0006uv-VP; Mon, 05 Dec 2011 15:09:23 +0000 Received: from mail-bw0-f49.google.com ([209.85.214.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RXaAE-0006s9-Fi for linux-mtd@lists.infradead.org; Mon, 05 Dec 2011 15:09:08 +0000 Received: by bkcje16 with SMTP id je16so4360364bkc.36 for ; Mon, 05 Dec 2011 07:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=UsY37AympwSRa1MPQ8RD4k5c37KkdLdSE0DcJAZfVpY=; b=rzW6yi+jau0FIdjYcGLaRZs0n717FIAfXo2WEbeM1TR2iHtHOzhwPTnXt2S1zckwCr 2ocQRDASb2rw+a27pkcgSj+xHPn9XKZcxwxW6FFPp+PQPAqw6on9DCqm0JGGnmu6Y4E+ lHeOrivoJmbfdXiIUTgRild/OtTlyhl3biym4= Received: by 10.180.80.162 with SMTP id s2mr13171295wix.27.1323097745175; Mon, 05 Dec 2011 07:09:05 -0800 (PST) Received: from shaker64.lan (dslb-088-073-137-229.pools.arcor-ip.net. [88.73.137.229]) by mx.google.com with ESMTPS id dd4sm10772157wib.1.2011.12.05.07.09.03 (version=SSLv3 cipher=OTHER); Mon, 05 Dec 2011 07:09:04 -0800 (PST) From: Jonas Gorski To: linux-mtd@lists.infradead.org Subject: [PATCH 5/7] MTD: MAPS: physmap: allow partition parsers for physmap_flash_data Date: Mon, 5 Dec 2011 16:08:09 +0100 Message-Id: <1323097691-16414-6-git-send-email-jonas.gorski@gmail.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1323097691-16414-1-git-send-email-jonas.gorski@gmail.com> References: <1323097691-16414-1-git-send-email-jonas.gorski@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (jonas.gorski[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: linux-mips@linux-mips.org, Artem Bityutskiy , David Woodhouse , Florian Fainelli , Ralf Baechle X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Arch setup code might want to use their own partition parsers, but still use the generic physmap flash driver. Signed-off-by: Jonas Gorski --- drivers/mtd/maps/physmap.c | 5 ++++- include/linux/mtd/physmap.h | 1 + 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 66e8200..1f749d58 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c @@ -85,6 +85,7 @@ static int physmap_flash_probe(struct platform_device *dev) struct physmap_flash_data *physmap_data; struct physmap_flash_info *info; const char **probe_type; + const char **part_types; int err = 0; int i; int devices_found = 0; @@ -171,7 +172,9 @@ static int physmap_flash_probe(struct platform_device *dev) if (err) goto err_out; - mtd_device_parse_register(info->cmtd, part_probe_types, 0, + part_types = physmap_data->part_probe_types ? : part_probe_types; + + mtd_device_parse_register(info->cmtd, part_types, 0, physmap_data->parts, physmap_data->nr_parts); return 0; diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h index 04e0181..d2887e7 100644 --- a/include/linux/mtd/physmap.h +++ b/include/linux/mtd/physmap.h @@ -30,6 +30,7 @@ struct physmap_flash_data { unsigned int pfow_base; char *probe_type; struct mtd_partition *parts; + const char **part_probe_types; }; #endif /* __LINUX_MTD_PHYSMAP__ */