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 39/43] mtd: tmio_nand.c: use mtd_device_parse_register
Date: Wed, 8 Jun 2011 20:05:48 +0400 [thread overview]
Message-ID: <1307549152-7085-40-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/tmio_nand.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/mtd/nand/tmio_nand.c b/drivers/mtd/nand/tmio_nand.c
index b6ffad6..d476857 100644
--- a/drivers/mtd/nand/tmio_nand.c
+++ b/drivers/mtd/nand/tmio_nand.c
@@ -378,8 +378,6 @@ static int tmio_probe(struct platform_device *dev)
struct tmio_nand *tmio;
struct mtd_info *mtd;
struct nand_chip *nand_chip;
- struct mtd_partition *parts;
- int nbparts = 0;
int retval;
if (data == NULL)
@@ -458,13 +456,9 @@ static int tmio_probe(struct platform_device *dev)
goto err_scan;
}
/* Register the partitions */
- nbparts = parse_mtd_partitions(mtd, NULL, &parts, 0);
- if (nbparts <= 0 && data) {
- parts = data->partition;
- nbparts = data->num_partitions;
- }
-
- retval = mtd_device_register(mtd, parts, nbparts);
+ retval = mtd_device_register(mtd, NULL, 0,
+ data ? data->partition : NULL,
+ data ? data->num_partitions : 0);
if (!retval)
return retval;
--
1.7.4.4
next prev parent reply other threads:[~2011-06-08 16:07 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 ` [PATCH 31/43] mtd: mxc_nand.c: " Dmitry Eremin-Solenikov
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 ` Dmitry Eremin-Solenikov [this message]
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-40-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).