linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Few additional cleanup patches
@ 2011-06-23 12:05 Dmitry Eremin-Solenikov
  2011-06-23 12:05 ` [PATCH 1/5] mtd/maps: drop edb7312 support Dmitry Eremin-Solenikov
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-06-23 12:05 UTC (permalink / raw)
  To: linux-mtd; +Cc: David Woodhouse, dedekind1

The following changes since commit 8c2ce1c78ba6cce94d0dfe6c674ea6c0cba56899:

  mtd: socrates_nand.c: use mtd_device_parse_register (2011-06-23 10:43:39 +0300)

are available in the git repository at:
  git://git.infradead.org/users/dbaryshkov/mtd-cleanup.git mtd-big-cleanup

Dmitry Eremin-Solenikov (5):
      mtd/maps: drop edb7312 support
      mtd/nand: drop edb7312 support
      mtd: hide parse_mtd_partitions
      mtd: remove put_partition_parser() from public header
      mtd: drop mtd_device_register

 drivers/mtd/maps/Kconfig       |    7 --
 drivers/mtd/maps/Makefile      |    1 -
 drivers/mtd/maps/edb7312.c     |  135 ----------------------------
 drivers/mtd/mtdcore.c          |   23 -----
 drivers/mtd/mtdcore.h          |    4 +
 drivers/mtd/mtdpart.c          |    3 +-
 drivers/mtd/nand/Kconfig       |    7 --
 drivers/mtd/nand/Makefile      |    1 -
 drivers/mtd/nand/edb7312.c     |  188 ----------------------------------------
 include/linux/mtd/mtd.h        |    5 +-
 include/linux/mtd/partitions.h |    5 -
 11 files changed, 8 insertions(+), 371 deletions(-)
 delete mode 100644 drivers/mtd/maps/edb7312.c
 delete mode 100644 drivers/mtd/nand/edb7312.c

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] mtd/maps: drop edb7312 support
  2011-06-23 12:05 [PATCH 0/5] Few additional cleanup patches Dmitry Eremin-Solenikov
@ 2011-06-23 12:05 ` Dmitry Eremin-Solenikov
  2011-06-23 12:05 ` [PATCH 2/5] mtd/nand: " Dmitry Eremin-Solenikov
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-06-23 12:05 UTC (permalink / raw)
  To: linux-mtd; +Cc: David Woodhouse, dedekind1

EDB7312 isn't supported by mainline kernel, this driver wasn't working
before recent fixes, the same functionality can be achieved via physmap,
so drop it now. If the board support will ever be submitted to mainline,
one either can revert this commit, or use physmap mtd map driver.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/mtd/maps/Kconfig   |    7 --
 drivers/mtd/maps/Makefile  |    1 -
 drivers/mtd/maps/edb7312.c |  135 --------------------------------------------
 3 files changed, 0 insertions(+), 143 deletions(-)
 delete mode 100644 drivers/mtd/maps/edb7312.c

diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index 46eca3b..891a9e6 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -392,13 +392,6 @@ config MTD_AUTCPU12
 	  This enables access to the NV-RAM on autronix autcpu12 board.
 	  If you have such a board, say 'Y'.
 
-config MTD_EDB7312
-	tristate "CFI Flash device mapped on EDB7312"
-	depends on ARCH_EDB7312 && MTD_CFI
-	help
-	  This enables access to the CFI Flash on the Cogent EDB7312 board.
-	  If you have such a board, say 'Y' here.
-
 config MTD_IMPA7
 	tristate "JEDEC Flash device mapped on impA7"
 	depends on ARM && MTD_JEDECPROBE
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile
index d6379fe..45dcb8b 100644
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -39,7 +39,6 @@ obj-$(CONFIG_MTD_DBOX2)		+= dbox2-flash.o
 obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o
 obj-$(CONFIG_MTD_PCI)		+= pci.o
 obj-$(CONFIG_MTD_AUTCPU12)	+= autcpu12-nvram.o
-obj-$(CONFIG_MTD_EDB7312)	+= edb7312.o
 obj-$(CONFIG_MTD_IMPA7)		+= impa7.o
 obj-$(CONFIG_MTD_FORTUNET)	+= fortunet.o
 obj-$(CONFIG_MTD_UCLINUX)	+= uclinux.o
diff --git a/drivers/mtd/maps/edb7312.c b/drivers/mtd/maps/edb7312.c
deleted file mode 100644
index b07acd6..0000000
--- a/drivers/mtd/maps/edb7312.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Handle mapping of the NOR flash on Cogent EDB7312 boards
- *
- * Copyright 2002 SYSGO Real-Time Solutions GmbH
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <asm/io.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/map.h>
-#include <linux/mtd/partitions.h>
-
-#define WINDOW_ADDR 0x00000000      /* physical properties of flash */
-#define WINDOW_SIZE 0x01000000
-#define BUSWIDTH    2
-#define FLASH_BLOCKSIZE_MAIN	0x20000
-#define FLASH_NUMBLOCKS_MAIN	128
-/* can be "cfi_probe", "jedec_probe", "map_rom", NULL }; */
-#define PROBETYPES { "cfi_probe", NULL }
-
-#define MSG_PREFIX "EDB7312-NOR:"   /* prefix for our printk()'s */
-#define MTDID      "edb7312-nor"    /* for mtdparts= partitioning */
-
-static struct mtd_info *mymtd;
-
-struct map_info edb7312nor_map = {
-	.name = "NOR flash on EDB7312",
-	.size = WINDOW_SIZE,
-	.bankwidth = BUSWIDTH,
-	.phys = WINDOW_ADDR,
-};
-
-/*
- * MTD partitioning stuff
- */
-static struct mtd_partition static_partitions[3] =
-{
-	{
-		.name = "ARMboot",
-		.size = 0x40000,
-		.offset = 0
-	},
-	{
-		.name = "Kernel",
-		.size = 0x200000,
-		.offset = 0x40000
-	},
-	{
-		.name = "RootFS",
-		.size = 0xDC0000,
-		.offset = 0x240000
-	},
-};
-
-static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
-
-static int                   mtd_parts_nb = 0;
-static struct mtd_partition *mtd_parts    = 0;
-
-static int __init init_edb7312nor(void)
-{
-	static const char *rom_probe_types[] = PROBETYPES;
-	const char **type;
-	const char *part_type = 0;
-
-       	printk(KERN_NOTICE MSG_PREFIX "0x%08x at 0x%08x\n",
-	       WINDOW_SIZE, WINDOW_ADDR);
-	edb7312nor_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE);
-
-	if (!edb7312nor_map.virt) {
-		printk(MSG_PREFIX "failed to ioremap\n");
-		return -EIO;
-	}
-
-	simple_map_init(&edb7312nor_map);
-
-	mymtd = 0;
-	type = rom_probe_types;
-	for(; !mymtd && *type; type++) {
-		mymtd = do_map_probe(*type, &edb7312nor_map);
-	}
-	if (mymtd) {
-		mymtd->owner = THIS_MODULE;
-		mymtd->name = MTDID;
-
-		mtd_parts_nb = parse_mtd_partitions(mymtd, probes, &mtd_parts, 0);
-		if (mtd_parts_nb > 0)
-			part_type = "detected";
-
-		if (mtd_parts_nb == 0) {
-			mtd_parts = static_partitions;
-			mtd_parts_nb = ARRAY_SIZE(static_partitions);
-			part_type = "static";
-		}
-
-		if (mtd_parts_nb == 0)
-			printk(KERN_NOTICE MSG_PREFIX "no partition info available\n");
-		else
-			printk(KERN_NOTICE MSG_PREFIX
-			       "using %s partition definition\n", part_type);
-		/* Register the whole device first. */
-		mtd_device_register(mymtd, NULL, 0);
-		mtd_device_register(mymtd, mtd_parts, mtd_parts_nb);
-		return 0;
-	}
-
-	iounmap((void *)edb7312nor_map.virt);
-	return -ENXIO;
-}
-
-static void __exit cleanup_edb7312nor(void)
-{
-	if (mymtd) {
-		mtd_device_unregister(mymtd);
-		map_destroy(mymtd);
-	}
-	if (edb7312nor_map.virt) {
-		iounmap((void *)edb7312nor_map.virt);
-		edb7312nor_map.virt = 0;
-	}
-}
-
-module_init(init_edb7312nor);
-module_exit(cleanup_edb7312nor);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Marius Groeger <mag@sysgo.de>");
-MODULE_DESCRIPTION("Generic configurable MTD map driver");
-- 
1.7.5.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] mtd/nand: drop edb7312 support
  2011-06-23 12:05 [PATCH 0/5] Few additional cleanup patches Dmitry Eremin-Solenikov
  2011-06-23 12:05 ` [PATCH 1/5] mtd/maps: drop edb7312 support Dmitry Eremin-Solenikov
@ 2011-06-23 12:05 ` Dmitry Eremin-Solenikov
  2011-06-23 12:05 ` [PATCH 3/5] mtd: hide parse_mtd_partitions Dmitry Eremin-Solenikov
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-06-23 12:05 UTC (permalink / raw)
  To: linux-mtd; +Cc: David Woodhouse, dedekind1

EDB7312 isn't supported by mainline kernel, so drop it now.
If the board support will ever be submitted to mainline,
one can revert this commit.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/mtd/nand/Kconfig   |    7 --
 drivers/mtd/nand/Makefile  |    1 -
 drivers/mtd/nand/edb7312.c |  188 --------------------------------------------
 3 files changed, 0 insertions(+), 196 deletions(-)
 delete mode 100644 drivers/mtd/nand/edb7312.c

diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 4c34252..17235d0 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -83,13 +83,6 @@ config MTD_NAND_DENALI_SCRATCH_REG_ADDR
           scratch register here to enable this feature. On Intel Moorestown
           boards, the scratch register is at 0xFF108018.
 
-config MTD_NAND_EDB7312
-	tristate "Support for Cirrus Logic EBD7312 evaluation board"
-	depends on ARCH_EDB7312
-	help
-	  This enables the driver for the Cirrus Logic EBD7312 evaluation
-	  board to access the onboard NAND Flash.
-
 config MTD_NAND_H1900
 	tristate "iPAQ H1900 flash"
 	depends on ARCH_PXA
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 5745d83..c9334e9 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -13,7 +13,6 @@ obj-$(CONFIG_MTD_NAND_SPIA)		+= spia.o
 obj-$(CONFIG_MTD_NAND_AMS_DELTA)	+= ams-delta.o
 obj-$(CONFIG_MTD_NAND_AUTCPU12)		+= autcpu12.o
 obj-$(CONFIG_MTD_NAND_DENALI)		+= denali.o
-obj-$(CONFIG_MTD_NAND_EDB7312)		+= edb7312.o
 obj-$(CONFIG_MTD_NAND_AU1550)		+= au1550nd.o
 obj-$(CONFIG_MTD_NAND_BF5XX)		+= bf5xx_nand.o
 obj-$(CONFIG_MTD_NAND_PPCHAMELEONEVB)	+= ppchameleonevb.o
diff --git a/drivers/mtd/nand/edb7312.c b/drivers/mtd/nand/edb7312.c
deleted file mode 100644
index 0b1bb91..0000000
--- a/drivers/mtd/nand/edb7312.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- *  drivers/mtd/nand/edb7312.c
- *
- *  Copyright (C) 2002 Marius Gröger (mag@sysgo.de)
- *
- *  Derived from drivers/mtd/nand/autcpu12.c
- *       Copyright (c) 2001 Thomas Gleixner (gleixner@autronix.de)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- *  Overview:
- *   This is a device driver for the NAND flash device found on the
- *   CLEP7312 board which utilizes the Toshiba TC58V64AFT part. This is
- *   a 64Mibit (8MiB x 8 bits) NAND flash device.
- */
-
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/nand.h>
-#include <linux/mtd/partitions.h>
-#include <asm/io.h>
-#include <mach/hardware.h>	/* for CLPS7111_VIRT_BASE */
-#include <asm/sizes.h>
-#include <asm/hardware/clps7111.h>
-
-/*
- * MTD structure for EDB7312 board
- */
-static struct mtd_info *ep7312_mtd = NULL;
-
-/*
- * Values specific to the EDB7312 board (used with EP7312 processor)
- */
-#define EP7312_FIO_PBASE 0x10000000	/* Phys address of flash */
-#define EP7312_PXDR	0x0001	/*
-				 * IO offset to Port B data register
-				 * where the CLE, ALE and NCE pins
-				 * are wired to.
-				 */
-#define EP7312_PXDDR	0x0041	/*
-				 * IO offset to Port B data direction
-				 * register so we can control the IO
-				 * lines.
-				 */
-
-/*
- * Module stuff
- */
-
-static unsigned long ep7312_fio_pbase = EP7312_FIO_PBASE;
-static void __iomem *ep7312_pxdr = (void __iomem *)EP7312_PXDR;
-static void __iomem *ep7312_pxddr = (void __iomem *)EP7312_PXDDR;
-
-/*
- * Define static partitions for flash device
- */
-static struct mtd_partition partition_info[] = {
-	{.name = "EP7312 Nand Flash",
-	 .offset = 0,
-	 .size = 8 * 1024 * 1024}
-};
-
-#define NUM_PARTITIONS 1
-
-/*
- *	hardware specific access to control-lines
- *
- *	NAND_NCE: bit 0 -> bit 6 (bit 7 = 1)
- *	NAND_CLE: bit 1 -> bit 4
- *	NAND_ALE: bit 2 -> bit 5
- */
-static void ep7312_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
-{
-	struct nand_chip *chip = mtd->priv;
-
-	if (ctrl & NAND_CTRL_CHANGE) {
-		unsigned char bits = 0x80;
-
-		bits |= (ctrl & (NAND_CLE | NAND_ALE)) << 3;
-		bits |= (ctrl & NAND_NCE) ? 0x00 : 0x40;
-
-		clps_writeb((clps_readb(ep7312_pxdr)  & 0xF0) | bits,
-			    ep7312_pxdr);
-	}
-	if (cmd != NAND_CMD_NONE)
-		writeb(cmd, chip->IO_ADDR_W);
-}
-
-/*
- *	read device ready pin
- */
-static int ep7312_device_ready(struct mtd_info *mtd)
-{
-	return 1;
-}
-
-/*
- * Main initialization routine
- */
-static int __init ep7312_init(void)
-{
-	struct nand_chip *this;
-	void __iomem *ep7312_fio_base;
-
-	/* Allocate memory for MTD device structure and private data */
-	ep7312_mtd = kmalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL);
-	if (!ep7312_mtd) {
-		printk("Unable to allocate EDB7312 NAND MTD device structure.\n");
-		return -ENOMEM;
-	}
-
-	/* map physical address */
-	ep7312_fio_base = ioremap(ep7312_fio_pbase, SZ_1K);
-	if (!ep7312_fio_base) {
-		printk("ioremap EDB7312 NAND flash failed\n");
-		kfree(ep7312_mtd);
-		return -EIO;
-	}
-
-	/* Get pointer to private data */
-	this = (struct nand_chip *)(&ep7312_mtd[1]);
-
-	/* Initialize structures */
-	memset(ep7312_mtd, 0, sizeof(struct mtd_info));
-	memset(this, 0, sizeof(struct nand_chip));
-
-	/* Link the private data with the MTD structure */
-	ep7312_mtd->priv = this;
-	ep7312_mtd->owner = THIS_MODULE;
-
-	/*
-	 * Set GPIO Port B control register so that the pins are configured
-	 * to be outputs for controlling the NAND flash.
-	 */
-	clps_writeb(0xf0, ep7312_pxddr);
-
-	/* insert callbacks */
-	this->IO_ADDR_R = ep7312_fio_base;
-	this->IO_ADDR_W = ep7312_fio_base;
-	this->cmd_ctrl = ep7312_hwcontrol;
-	this->dev_ready = ep7312_device_ready;
-	/* 15 us command delay time */
-	this->chip_delay = 15;
-
-	/* Scan to find existence of the device */
-	if (nand_scan(ep7312_mtd, 1)) {
-		iounmap((void *)ep7312_fio_base);
-		kfree(ep7312_mtd);
-		return -ENXIO;
-	}
-	ep7312_mtd->name = "edb7312-nand";
-
-	/* Register the partitions */
-	mtd_device_register(ep7312_mtd, NULL, 0,
-			partition_info, NUM_PARTITIONS);
-
-	/* Return happy */
-	return 0;
-}
-
-module_init(ep7312_init);
-
-/*
- * Clean up routine
- */
-static void __exit ep7312_cleanup(void)
-{
-	struct nand_chip *this = (struct nand_chip *)&ep7312_mtd[1];
-
-	/* Release resources, unregister device */
-	nand_release(ap7312_mtd);
-
-	/* Release io resource */
-	iounmap(this->IO_ADDR_R);
-
-	/* Free the MTD device structure */
-	kfree(ep7312_mtd);
-}
-
-module_exit(ep7312_cleanup);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Marius Groeger <mag@sysgo.de>");
-MODULE_DESCRIPTION("MTD map driver for Cogent EDB7312 board");
-- 
1.7.5.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] mtd: hide parse_mtd_partitions
  2011-06-23 12:05 [PATCH 0/5] Few additional cleanup patches Dmitry Eremin-Solenikov
  2011-06-23 12:05 ` [PATCH 1/5] mtd/maps: drop edb7312 support Dmitry Eremin-Solenikov
  2011-06-23 12:05 ` [PATCH 2/5] mtd/nand: " Dmitry Eremin-Solenikov
@ 2011-06-23 12:05 ` Dmitry Eremin-Solenikov
  2011-06-23 12:05 ` [PATCH 4/5] mtd: remove put_partition_parser() from public header Dmitry Eremin-Solenikov
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-06-23 12:05 UTC (permalink / raw)
  To: linux-mtd; +Cc: David Woodhouse, dedekind1

There is no need to export parse_mtd_partitions() now , as it's fully handled
by registration functions. So move the definition to private header and
remove respective EXPORT_SYMBOL_GPL.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/mtd/mtdcore.h          |    4 ++++
 drivers/mtd/mtdpart.c          |    1 -
 include/linux/mtd/partitions.h |    3 ---
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/mtdcore.h b/drivers/mtd/mtdcore.h
index 0ed6126..7e7d1a3b 100644
--- a/drivers/mtd/mtdcore.h
+++ b/drivers/mtd/mtdcore.h
@@ -15,8 +15,12 @@ extern int del_mtd_device(struct mtd_info *mtd);
 extern int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *,
 			      int);
 extern int del_mtd_partitions(struct mtd_info *);
+extern int parse_mtd_partitions(struct mtd_info *master, const char **types,
+				struct mtd_partition **pparts,
+				struct mtd_part_parser_data *data);
 
 #define mtd_for_each_device(mtd)			\
 	for ((mtd) = __mtd_next_device(0);		\
 	     (mtd) != NULL;				\
 	     (mtd) = __mtd_next_device(mtd->index + 1))
+
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 9e8ee05..6997c6c 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -778,7 +778,6 @@ int parse_mtd_partitions(struct mtd_info *master, const char **types,
 	}
 	return ret;
 }
-EXPORT_SYMBOL_GPL(parse_mtd_partitions);
 
 int mtd_is_partition(struct mtd_info *mtd)
 {
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index a8a961a..c98d6b8 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -78,9 +78,6 @@ struct mtd_part_parser {
 
 extern int register_mtd_parser(struct mtd_part_parser *parser);
 extern int deregister_mtd_parser(struct mtd_part_parser *parser);
-extern int parse_mtd_partitions(struct mtd_info *master, const char **types,
-				struct mtd_partition **pparts,
-				struct mtd_part_parser_data *data);
 
 #define put_partition_parser(p) do { module_put((p)->owner); } while(0)
 
-- 
1.7.5.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] mtd: remove put_partition_parser() from public header
  2011-06-23 12:05 [PATCH 0/5] Few additional cleanup patches Dmitry Eremin-Solenikov
                   ` (2 preceding siblings ...)
  2011-06-23 12:05 ` [PATCH 3/5] mtd: hide parse_mtd_partitions Dmitry Eremin-Solenikov
@ 2011-06-23 12:05 ` Dmitry Eremin-Solenikov
  2011-06-23 12:05 ` [PATCH 5/5] mtd: drop mtd_device_register Dmitry Eremin-Solenikov
  2011-06-24 19:36 ` [PATCH 0/5] Few additional cleanup patches Artem Bityutskiy
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-06-23 12:05 UTC (permalink / raw)
  To: linux-mtd; +Cc: David Woodhouse, dedekind1

There is no need to pollute public header with a definition private
to mtdpart.c. Move it from mtd/partitions.h to mtdpart.c

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/mtd/mtdpart.c          |    2 ++
 include/linux/mtd/partitions.h |    2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 6997c6c..c90b7ba 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -706,6 +706,8 @@ static struct mtd_part_parser *get_partition_parser(const char *name)
 	return ret;
 }
 
+#define put_partition_parser(p) do { module_put((p)->owner); } while (0)
+
 int register_mtd_parser(struct mtd_part_parser *p)
 {
 	spin_lock(&part_parser_lock);
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index c98d6b8..2475228 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -79,8 +79,6 @@ struct mtd_part_parser {
 extern int register_mtd_parser(struct mtd_part_parser *parser);
 extern int deregister_mtd_parser(struct mtd_part_parser *parser);
 
-#define put_partition_parser(p) do { module_put((p)->owner); } while(0)
-
 int mtd_is_partition(struct mtd_info *mtd);
 int mtd_add_partition(struct mtd_info *master, char *name,
 		      long long offset, long long length);
-- 
1.7.5.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] mtd: drop mtd_device_register
  2011-06-23 12:05 [PATCH 0/5] Few additional cleanup patches Dmitry Eremin-Solenikov
                   ` (3 preceding siblings ...)
  2011-06-23 12:05 ` [PATCH 4/5] mtd: remove put_partition_parser() from public header Dmitry Eremin-Solenikov
@ 2011-06-23 12:05 ` Dmitry Eremin-Solenikov
  2011-06-24 19:36 ` [PATCH 0/5] Few additional cleanup patches Artem Bityutskiy
  5 siblings, 0 replies; 7+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-06-23 12:05 UTC (permalink / raw)
  To: linux-mtd; +Cc: David Woodhouse, dedekind1

mtd_device_register() is a limited version of mtd_device_parse_register.
Replace it with macro calling mtd_device_parse_register().

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/mtd/mtdcore.c   |   23 -----------------------
 include/linux/mtd/mtd.h |    5 ++---
 2 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index e186399..f9cc2d2 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -429,29 +429,6 @@ out_error:
 }
 
 /**
- * mtd_device_register - register an MTD device.
- *
- * @master: the MTD device to register
- * @parts: the partitions to register - only valid if nr_parts > 0
- * @nr_parts: the number of partitions in parts.  If zero then the full MTD
- *            device is registered
- *
- * Register an MTD device with the system and optionally, a number of
- * partitions.  If nr_parts is 0 then the whole device is registered, otherwise
- * only the partitions are registered.  To register both the full device *and*
- * the partitions, call mtd_device_register() twice, once with nr_parts == 0
- * and once equal to the number of partitions.
- */
-int mtd_device_register(struct mtd_info *master,
-			const struct mtd_partition *parts,
-			int nr_parts)
-{
-	return parts ? add_mtd_partitions(master, parts, nr_parts) :
-		add_mtd_device(master);
-}
-EXPORT_SYMBOL_GPL(mtd_device_register);
-
-/**
  * mtd_device_parse_register - parse partitions and register an MTD device.
  *
  * @mtd: the MTD device to register
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index b2b454b..67774f9 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -325,14 +325,13 @@ static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd)
 struct mtd_partition;
 struct mtd_part_parser_data;
 
-extern int mtd_device_register(struct mtd_info *master,
-			       const struct mtd_partition *parts,
-			       int nr_parts);
 extern int mtd_device_parse_register(struct mtd_info *mtd,
 			      const char **part_probe_types,
 			      struct mtd_part_parser_data *parser_data,
 			      const struct mtd_partition *defparts,
 			      int defnr_parts);
+#define mtd_device_register(master, parts, nr_parts)	\
+	mtd_device_parse_register(master, NULL, NULL, parts, nr_parts)
 extern int mtd_device_unregister(struct mtd_info *master);
 extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num);
 extern int __get_mtd_device(struct mtd_info *mtd);
-- 
1.7.5.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5] Few additional cleanup patches
  2011-06-23 12:05 [PATCH 0/5] Few additional cleanup patches Dmitry Eremin-Solenikov
                   ` (4 preceding siblings ...)
  2011-06-23 12:05 ` [PATCH 5/5] mtd: drop mtd_device_register Dmitry Eremin-Solenikov
@ 2011-06-24 19:36 ` Artem Bityutskiy
  5 siblings, 0 replies; 7+ messages in thread
From: Artem Bityutskiy @ 2011-06-24 19:36 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov; +Cc: David Woodhouse, linux-mtd

On Thu, 2011-06-23 at 16:05 +0400, Dmitry Eremin-Solenikov wrote:
> The following changes since commit 8c2ce1c78ba6cce94d0dfe6c674ea6c0cba56899:
> 
>   mtd: socrates_nand.c: use mtd_device_parse_register (2011-06-23 10:43:39 +0300)
> 
> are available in the git repository at:
>   git://git.infradead.org/users/dbaryshkov/mtd-cleanup.git mtd-big-cleanup
> 
> Dmitry Eremin-Solenikov (5):
>       mtd/maps: drop edb7312 support
>       mtd/nand: drop edb7312 support
>       mtd: hide parse_mtd_partitions
>       mtd: remove put_partition_parser() from public header
>       mtd: drop mtd_device_register

Pushed to l2-mtd-2.6.git, thanks!

-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-06-24 19:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-23 12:05 [PATCH 0/5] Few additional cleanup patches Dmitry Eremin-Solenikov
2011-06-23 12:05 ` [PATCH 1/5] mtd/maps: drop edb7312 support Dmitry Eremin-Solenikov
2011-06-23 12:05 ` [PATCH 2/5] mtd/nand: " Dmitry Eremin-Solenikov
2011-06-23 12:05 ` [PATCH 3/5] mtd: hide parse_mtd_partitions Dmitry Eremin-Solenikov
2011-06-23 12:05 ` [PATCH 4/5] mtd: remove put_partition_parser() from public header Dmitry Eremin-Solenikov
2011-06-23 12:05 ` [PATCH 5/5] mtd: drop mtd_device_register Dmitry Eremin-Solenikov
2011-06-24 19:36 ` [PATCH 0/5] Few additional cleanup patches Artem Bityutskiy

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).