From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: David Woodhouse <dwmw2@infradead.org>,
Russell King <linux@arm.linux.org.uk>,
dedekind1@gmail.com
Subject: [PATCH 31/43] mtd: mxc_nand.c: use mtd_device_parse_register
Date: Wed, 8 Jun 2011 20:05:40 +0400 [thread overview]
Message-ID: <1307549152-7085-32-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1307549152-7085-1-git-send-email-dbaryshkov@gmail.com>
Replace custom invocations of parse_mtd_partitions and mtd_device_register
with common mtd_device_parse_register call. This would bring: standard
handling of all errors, fallback to default partitions, etc.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
drivers/mtd/nand/mxc_nand.c | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index ca42c8f..4c2bb4a 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -143,7 +143,6 @@
struct mxc_nand_host {
struct mtd_info mtd;
struct nand_chip nand;
- struct mtd_partition *parts;
struct device *dev;
void *spare0;
@@ -1044,7 +1043,7 @@ static int __init mxcnd_probe(struct platform_device *pdev)
struct mxc_nand_platform_data *pdata = pdev->dev.platform_data;
struct mxc_nand_host *host;
struct resource *res;
- int err = 0, __maybe_unused nr_parts = 0;
+ int err = 0;
struct nand_ecclayout *oob_smallpage, *oob_largepage;
/* Allocate memory for MTD device structure and private data */
@@ -1231,16 +1230,8 @@ static int __init mxcnd_probe(struct platform_device *pdev)
}
/* Register the partitions */
- nr_parts =
- parse_mtd_partitions(mtd, part_probes, &host->parts, 0);
- if (nr_parts > 0)
- mtd_device_register(mtd, host->parts, nr_parts);
- else if (pdata->parts)
- mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
- else {
- pr_info("Registering %s as whole device\n", mtd->name);
- mtd_device_register(mtd, NULL, 0);
- }
+ mtd_device_parse_register(mtd, part_probes, 0,
+ pdata->parts, pdata->nr_parts);
platform_set_drvdata(pdev, host);
--
1.7.4.4
next prev parent reply other threads:[~2011-06-08 16:06 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-08 16:05 [PATCH 0/43 V2] mtd: simplify mtd partitions handling Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 01/43] mtd: add new API for handling MTD registration Dmitry Eremin-Solenikov
2011-06-09 7:20 ` Artem Bityutskiy
2011-06-08 16:05 ` [PATCH 02/43] mtd: mtd_dataflash.c: use mtd_device_parse_register Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 03/43] mtd: sst25l.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 04/43] mtd: bfin-async-flash.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 05/43] mtd: dc21285.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 06/43] mtd: gpio-addr-flash.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 07/43] mtd: h720x-flash.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 08/43] mtd: impa7.c: " Dmitry Eremin-Solenikov
2011-06-09 7:24 ` Artem Bityutskiy
2011-06-08 16:05 ` [PATCH 09/43] mtd: intel_vr_nor.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 10/43] mtd: ixp2000.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 11/43] mtd: ixp4xx.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 12/43] mtd: lantiq-flash.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 13/43] mtd: latch-addr-flash.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 14/43] mtd: physmap.c: " Dmitry Eremin-Solenikov
2011-06-09 7:32 ` Artem Bityutskiy
2011-06-08 16:05 ` [PATCH 15/43] mtd: plat-ram.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 16/43] mtd: pxa2xx-flash.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 17/43] mtd: rbtx4939-flash.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 18/43] mtd: sa1100-flash.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 19/43] mtd: solutionengine.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 20/43] mtd: wr_sbc82xx_flash.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 21/43] mtd: atmel_nand.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 22/43] mtd: bcm_umi_nand.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 23/43] mtd: cafe_nand.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 24/43] mtd: cmx270_nand.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 25/43] mtd: cs553x_nand.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 26/43] mtd: davinci_nand.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 27/43] mtd: edb7312.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 28/43] mtd: fsmc_nand.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 29/43] mtd: h1910.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 30/43] mtd: jz4740_nand.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` Dmitry Eremin-Solenikov [this message]
2011-06-08 16:05 ` [PATCH 32/43] mtd: omap2.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 33/43] mtd: orion_nand.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 34/43] mtd: plat_nand.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 35/43] mtd: ppchameleonevb.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 36/43] mtd: pxa3xx_nand.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 37/43] mtd: s3c2410.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 38/43] mtd: sharpsl.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 39/43] mtd: tmio_nand.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 40/43] mtd: txx9ndfmc.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 41/43] mtd: onenand/generic.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 42/43] mtd: onenand/omap2.c: " Dmitry Eremin-Solenikov
2011-06-08 16:05 ` [PATCH 43/43] mtd: onenand/samsung.c: " Dmitry Eremin-Solenikov
2011-06-09 7:56 ` [PATCH 0/43 V2] mtd: simplify mtd partitions handling Artem Bityutskiy
2011-06-09 8:23 ` Dmitry Eremin-Solenikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1307549152-7085-32-git-send-email-dbaryshkov@gmail.com \
--to=dbaryshkov@gmail.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).