All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/8] Switch ARM platforms from integrator-flash to physmap
@ 2011-05-17 13:11 ` Marc Zyngier
  0 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mtd; +Cc: David Woodhouse

As the integrator-flash driver is mostly a duplicate of physmap,
move all users of this driver to physmap and get rid of the
then unused driver.

Also change the set_vpp() method in physmap to pass the
platform_device instead of the map_info. This allows for a substantial
cleanup in drivers/mtd/maps/pismo.c

This patch set has been ok'ed by RMK, who is willing to take it
through his tree. This requires an ACK from the MTD maintainers. David
Woodhouse cc-ed on the whole patch set in case he'd prefer to merge it
via the MTD tree.

Changes since v5:
- Removed #ifdef around the afs partition name, as requested by
  Artem Bityutskiy
- Dropped changes to board-at572d940hf_ek.c, as the board is to be
  removed from the tree

Changes since v4:
- Changed set_vpp() method in physmap
- Rebased against v2.6.39-rc7

Changes since v3:
- Dropped patch for aaec2000 platform (removed from tree)
- Rebased against next-20110317

Changes since v2:
- Add integrator-flash's init()/exit() methods in order to control
  write access to the various onboard programmable components, as
  per RMK request.
- Rebased against 2.6.38-rc2

Changes since initial revision:
- Rebased against linux-next (20110107). It should apply cleanly
  on top of Linus' tree, except for a small conflict in the last
  patch of the serie.

Marc Zyngier (8):
  MTD: Add integrator-flash feature to physmap
  ARM: Realview: Use physmap driver instead of integrator-flash
  ARM: Versatile: Use physmap driver instead of integrator-flash
  ARM: VExpress: Use physmap driver instead of integrator-flash
  ARM: Integrator/AP: Use physmap driver instead of integrator-flash
  ARM: Integrator/CP: Use physmap driver instead of integrator-flash
  MTD: Remove integrator-flash
  MTD: physmap: let set_vpp() pass a platform_device instead of a
    map_info

 arch/arm/configs/realview-smp_defconfig  |    2 +-
 arch/arm/configs/realview_defconfig      |    2 +-
 arch/arm/configs/versatile_defconfig     |    2 +-
 arch/arm/mach-integrator/integrator_ap.c |   13 +-
 arch/arm/mach-integrator/integrator_cp.c |   13 +-
 arch/arm/mach-omap1/flash.c              |    2 +-
 arch/arm/mach-pxa/hx4700.c               |    2 +-
 arch/arm/mach-pxa/magician.c             |    2 +-
 arch/arm/mach-realview/core.c            |   31 +---
 arch/arm/mach-s3c2410/nor-simtec.c       |    2 +-
 arch/arm/mach-versatile/core.c           |   31 +---
 arch/arm/mach-vexpress/v2m.c             |   22 +--
 arch/arm/plat-omap/include/plat/flash.h  |    2 +-
 drivers/mtd/Kconfig                      |    3 +-
 drivers/mtd/maps/Makefile                |    1 -
 drivers/mtd/maps/integrator-flash.c      |  309 ------------------------------
 drivers/mtd/maps/physmap.c               |   28 +++-
 drivers/mtd/maps/pismo.c                 |   40 +----
 include/linux/mtd/physmap.h              |    4 +-
 19 files changed, 65 insertions(+), 446 deletions(-)
 delete mode 100644 drivers/mtd/maps/integrator-flash.c

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

* [PATCH v6 0/8] Switch ARM platforms from integrator-flash to physmap
@ 2011-05-17 13:11 ` Marc Zyngier
  0 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel

As the integrator-flash driver is mostly a duplicate of physmap,
move all users of this driver to physmap and get rid of the
then unused driver.

Also change the set_vpp() method in physmap to pass the
platform_device instead of the map_info. This allows for a substantial
cleanup in drivers/mtd/maps/pismo.c

This patch set has been ok'ed by RMK, who is willing to take it
through his tree. This requires an ACK from the MTD maintainers. David
Woodhouse cc-ed on the whole patch set in case he'd prefer to merge it
via the MTD tree.

Changes since v5:
- Removed #ifdef around the afs partition name, as requested by
  Artem Bityutskiy
- Dropped changes to board-at572d940hf_ek.c, as the board is to be
  removed from the tree

Changes since v4:
- Changed set_vpp() method in physmap
- Rebased against v2.6.39-rc7

Changes since v3:
- Dropped patch for aaec2000 platform (removed from tree)
- Rebased against next-20110317

Changes since v2:
- Add integrator-flash's init()/exit() methods in order to control
  write access to the various onboard programmable components, as
  per RMK request.
- Rebased against 2.6.38-rc2

Changes since initial revision:
- Rebased against linux-next (20110107). It should apply cleanly
  on top of Linus' tree, except for a small conflict in the last
  patch of the serie.

Marc Zyngier (8):
  MTD: Add integrator-flash feature to physmap
  ARM: Realview: Use physmap driver instead of integrator-flash
  ARM: Versatile: Use physmap driver instead of integrator-flash
  ARM: VExpress: Use physmap driver instead of integrator-flash
  ARM: Integrator/AP: Use physmap driver instead of integrator-flash
  ARM: Integrator/CP: Use physmap driver instead of integrator-flash
  MTD: Remove integrator-flash
  MTD: physmap: let set_vpp() pass a platform_device instead of a
    map_info

 arch/arm/configs/realview-smp_defconfig  |    2 +-
 arch/arm/configs/realview_defconfig      |    2 +-
 arch/arm/configs/versatile_defconfig     |    2 +-
 arch/arm/mach-integrator/integrator_ap.c |   13 +-
 arch/arm/mach-integrator/integrator_cp.c |   13 +-
 arch/arm/mach-omap1/flash.c              |    2 +-
 arch/arm/mach-pxa/hx4700.c               |    2 +-
 arch/arm/mach-pxa/magician.c             |    2 +-
 arch/arm/mach-realview/core.c            |   31 +---
 arch/arm/mach-s3c2410/nor-simtec.c       |    2 +-
 arch/arm/mach-versatile/core.c           |   31 +---
 arch/arm/mach-vexpress/v2m.c             |   22 +--
 arch/arm/plat-omap/include/plat/flash.h  |    2 +-
 drivers/mtd/Kconfig                      |    3 +-
 drivers/mtd/maps/Makefile                |    1 -
 drivers/mtd/maps/integrator-flash.c      |  309 ------------------------------
 drivers/mtd/maps/physmap.c               |   28 +++-
 drivers/mtd/maps/pismo.c                 |   40 +----
 include/linux/mtd/physmap.h              |    4 +-
 19 files changed, 65 insertions(+), 446 deletions(-)
 delete mode 100644 drivers/mtd/maps/integrator-flash.c

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

* [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
  2011-05-17 13:11 ` Marc Zyngier
@ 2011-05-17 13:11   ` Marc Zyngier
  -1 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mtd; +Cc: David Woodhouse

In the process of moving platforms away from integrator-flash
(aka armflash), add to physmap the few features that make
armflash unique:

- optionnal probing for the AFS partition type
- init() and exit() methods, used by Integrator to control
  write access to the various onboard programmable components

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 drivers/mtd/maps/physmap.c  |   16 +++++++++++++++-
 include/linux/mtd/physmap.h |    2 ++
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index 7522df4..49676b7 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -67,6 +67,10 @@ static int physmap_flash_remove(struct platform_device *dev)
 		if (info->mtd[i] != NULL)
 			map_destroy(info->mtd[i]);
 	}
+
+	if (physmap_data->exit)
+		physmap_data->exit(dev);
+
 	return 0;
 }
 
@@ -77,7 +81,11 @@ static const char *rom_probe_types[] = {
 					"map_rom",
 					NULL };
 #ifdef CONFIG_MTD_PARTITIONS
-static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
+static const char *part_probe_types[] = { "cmdlinepart", "RedBoot",
+#ifdef CONFIG_MTD_AFS_PARTS
+					  "afs",
+#endif
+					  NULL };
 #endif
 
 static int physmap_flash_probe(struct platform_device *dev)
@@ -100,6 +108,12 @@ static int physmap_flash_probe(struct platform_device *dev)
 		goto err_out;
 	}
 
+	if (physmap_data->init) {
+		err = physmap_data->init(dev);
+		if (err)
+			goto err_out;
+	}
+
 	platform_set_drvdata(dev, info);
 
 	for (i = 0; i < dev->num_resources; i++) {
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index bcfd9f7..d37cca0 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -22,6 +22,8 @@ struct map_info;
 
 struct physmap_flash_data {
 	unsigned int		width;
+	int			(*init)(struct platform_device *);
+	void			(*exit)(struct platform_device *);
 	void			(*set_vpp)(struct map_info *, int);
 	unsigned int		nr_parts;
 	unsigned int		pfow_base;
-- 
1.7.0.4

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

* [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
@ 2011-05-17 13:11   ` Marc Zyngier
  0 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel

In the process of moving platforms away from integrator-flash
(aka armflash), add to physmap the few features that make
armflash unique:

- optionnal probing for the AFS partition type
- init() and exit() methods, used by Integrator to control
  write access to the various onboard programmable components

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 drivers/mtd/maps/physmap.c  |   16 +++++++++++++++-
 include/linux/mtd/physmap.h |    2 ++
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index 7522df4..49676b7 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -67,6 +67,10 @@ static int physmap_flash_remove(struct platform_device *dev)
 		if (info->mtd[i] != NULL)
 			map_destroy(info->mtd[i]);
 	}
+
+	if (physmap_data->exit)
+		physmap_data->exit(dev);
+
 	return 0;
 }
 
@@ -77,7 +81,11 @@ static const char *rom_probe_types[] = {
 					"map_rom",
 					NULL };
 #ifdef CONFIG_MTD_PARTITIONS
-static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
+static const char *part_probe_types[] = { "cmdlinepart", "RedBoot",
+#ifdef CONFIG_MTD_AFS_PARTS
+					  "afs",
+#endif
+					  NULL };
 #endif
 
 static int physmap_flash_probe(struct platform_device *dev)
@@ -100,6 +108,12 @@ static int physmap_flash_probe(struct platform_device *dev)
 		goto err_out;
 	}
 
+	if (physmap_data->init) {
+		err = physmap_data->init(dev);
+		if (err)
+			goto err_out;
+	}
+
 	platform_set_drvdata(dev, info);
 
 	for (i = 0; i < dev->num_resources; i++) {
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index bcfd9f7..d37cca0 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -22,6 +22,8 @@ struct map_info;
 
 struct physmap_flash_data {
 	unsigned int		width;
+	int			(*init)(struct platform_device *);
+	void			(*exit)(struct platform_device *);
 	void			(*set_vpp)(struct map_info *, int);
 	unsigned int		nr_parts;
 	unsigned int		pfow_base;
-- 
1.7.0.4

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

* [PATCH v6 2/8] ARM: Realview: Use physmap driver instead of integrator-flash
  2011-05-17 13:11 ` Marc Zyngier
@ 2011-05-17 13:11   ` Marc Zyngier
  -1 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mtd; +Cc: David Woodhouse

Tested on a PB11-MPCore.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 arch/arm/configs/realview-smp_defconfig |    2 +-
 arch/arm/configs/realview_defconfig     |    2 +-
 arch/arm/mach-realview/core.c           |   31 ++++---------------------------
 3 files changed, 6 insertions(+), 29 deletions(-)

diff --git a/arch/arm/configs/realview-smp_defconfig b/arch/arm/configs/realview-smp_defconfig
index 5ca7a61..abe61bf 100644
--- a/arch/arm/configs/realview-smp_defconfig
+++ b/arch/arm/configs/realview-smp_defconfig
@@ -38,7 +38,7 @@ CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_ARM_INTEGRATOR=y
+CONFIG_MTD_PHYSMAP=y
 CONFIG_ARM_CHARLCD=y
 CONFIG_NETDEVICES=y
 CONFIG_SMSC_PHY=y
diff --git a/arch/arm/configs/realview_defconfig b/arch/arm/configs/realview_defconfig
index fcaa603..7079cbe 100644
--- a/arch/arm/configs/realview_defconfig
+++ b/arch/arm/configs/realview_defconfig
@@ -37,7 +37,7 @@ CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_ARM_INTEGRATOR=y
+CONFIG_MTD_PHYSMAP=y
 CONFIG_ARM_CHARLCD=y
 CONFIG_NETDEVICES=y
 CONFIG_SMSC_PHY=y
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 75dbc87..d3f1dde 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -31,6 +31,7 @@
 #include <linux/amba/mmci.h>
 #include <linux/gfp.h>
 #include <linux/clkdev.h>
+#include <linux/mtd/physmap.h>
 
 #include <asm/system.h>
 #include <mach/hardware.h>
@@ -41,7 +42,6 @@
 #include <asm/hardware/icst.h>
 
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/map.h>
 
@@ -77,27 +77,7 @@ void __init realview_adjust_zones(unsigned long *size, unsigned long *hole)
 
 #define REALVIEW_FLASHCTRL    (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET)
 
-static int realview_flash_init(void)
-{
-	u32 val;
-
-	val = __raw_readl(REALVIEW_FLASHCTRL);
-	val &= ~REALVIEW_FLASHPROG_FLVPPEN;
-	__raw_writel(val, REALVIEW_FLASHCTRL);
-
-	return 0;
-}
-
-static void realview_flash_exit(void)
-{
-	u32 val;
-
-	val = __raw_readl(REALVIEW_FLASHCTRL);
-	val &= ~REALVIEW_FLASHPROG_FLVPPEN;
-	__raw_writel(val, REALVIEW_FLASHCTRL);
-}
-
-static void realview_flash_set_vpp(int on)
+static void realview_flash_set_vpp(struct map_info *map, int on)
 {
 	u32 val;
 
@@ -109,16 +89,13 @@ static void realview_flash_set_vpp(int on)
 	__raw_writel(val, REALVIEW_FLASHCTRL);
 }
 
-static struct flash_platform_data realview_flash_data = {
-	.map_name		= "cfi_probe",
+static struct physmap_flash_data realview_flash_data = {
 	.width			= 4,
-	.init			= realview_flash_init,
-	.exit			= realview_flash_exit,
 	.set_vpp		= realview_flash_set_vpp,
 };
 
 struct platform_device realview_flash_device = {
-	.name			= "armflash",
+	.name			= "physmap-flash",
 	.id			= 0,
 	.dev			= {
 		.platform_data	= &realview_flash_data,
-- 
1.7.0.4

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

* [PATCH v6 2/8] ARM: Realview: Use physmap driver instead of integrator-flash
@ 2011-05-17 13:11   ` Marc Zyngier
  0 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel

Tested on a PB11-MPCore.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 arch/arm/configs/realview-smp_defconfig |    2 +-
 arch/arm/configs/realview_defconfig     |    2 +-
 arch/arm/mach-realview/core.c           |   31 ++++---------------------------
 3 files changed, 6 insertions(+), 29 deletions(-)

diff --git a/arch/arm/configs/realview-smp_defconfig b/arch/arm/configs/realview-smp_defconfig
index 5ca7a61..abe61bf 100644
--- a/arch/arm/configs/realview-smp_defconfig
+++ b/arch/arm/configs/realview-smp_defconfig
@@ -38,7 +38,7 @@ CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_ARM_INTEGRATOR=y
+CONFIG_MTD_PHYSMAP=y
 CONFIG_ARM_CHARLCD=y
 CONFIG_NETDEVICES=y
 CONFIG_SMSC_PHY=y
diff --git a/arch/arm/configs/realview_defconfig b/arch/arm/configs/realview_defconfig
index fcaa603..7079cbe 100644
--- a/arch/arm/configs/realview_defconfig
+++ b/arch/arm/configs/realview_defconfig
@@ -37,7 +37,7 @@ CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_CFI_AMDSTD=y
-CONFIG_MTD_ARM_INTEGRATOR=y
+CONFIG_MTD_PHYSMAP=y
 CONFIG_ARM_CHARLCD=y
 CONFIG_NETDEVICES=y
 CONFIG_SMSC_PHY=y
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 75dbc87..d3f1dde 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -31,6 +31,7 @@
 #include <linux/amba/mmci.h>
 #include <linux/gfp.h>
 #include <linux/clkdev.h>
+#include <linux/mtd/physmap.h>
 
 #include <asm/system.h>
 #include <mach/hardware.h>
@@ -41,7 +42,6 @@
 #include <asm/hardware/icst.h>
 
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/map.h>
 
@@ -77,27 +77,7 @@ void __init realview_adjust_zones(unsigned long *size, unsigned long *hole)
 
 #define REALVIEW_FLASHCTRL    (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET)
 
-static int realview_flash_init(void)
-{
-	u32 val;
-
-	val = __raw_readl(REALVIEW_FLASHCTRL);
-	val &= ~REALVIEW_FLASHPROG_FLVPPEN;
-	__raw_writel(val, REALVIEW_FLASHCTRL);
-
-	return 0;
-}
-
-static void realview_flash_exit(void)
-{
-	u32 val;
-
-	val = __raw_readl(REALVIEW_FLASHCTRL);
-	val &= ~REALVIEW_FLASHPROG_FLVPPEN;
-	__raw_writel(val, REALVIEW_FLASHCTRL);
-}
-
-static void realview_flash_set_vpp(int on)
+static void realview_flash_set_vpp(struct map_info *map, int on)
 {
 	u32 val;
 
@@ -109,16 +89,13 @@ static void realview_flash_set_vpp(int on)
 	__raw_writel(val, REALVIEW_FLASHCTRL);
 }
 
-static struct flash_platform_data realview_flash_data = {
-	.map_name		= "cfi_probe",
+static struct physmap_flash_data realview_flash_data = {
 	.width			= 4,
-	.init			= realview_flash_init,
-	.exit			= realview_flash_exit,
 	.set_vpp		= realview_flash_set_vpp,
 };
 
 struct platform_device realview_flash_device = {
-	.name			= "armflash",
+	.name			= "physmap-flash",
 	.id			= 0,
 	.dev			= {
 		.platform_data	= &realview_flash_data,
-- 
1.7.0.4

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

* [PATCH v6 3/8] ARM: Versatile: Use physmap driver instead of integrator-flash
  2011-05-17 13:11 ` Marc Zyngier
@ 2011-05-17 13:11   ` Marc Zyngier
  -1 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mtd; +Cc: David Woodhouse

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 arch/arm/configs/versatile_defconfig |    2 +-
 arch/arm/mach-versatile/core.c       |   31 ++++---------------------------
 2 files changed, 5 insertions(+), 28 deletions(-)

diff --git a/arch/arm/configs/versatile_defconfig b/arch/arm/configs/versatile_defconfig
index 0ce710f..cdd4d2b 100644
--- a/arch/arm/configs/versatile_defconfig
+++ b/arch/arm/configs/versatile_defconfig
@@ -32,7 +32,7 @@ CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_ADV_OPTIONS=y
 CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_ARM_INTEGRATOR=y
+CONFIG_MTD_PHYSMAP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_EEPROM_LEGACY=m
 CONFIG_NETDEVICES=y
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index eb7ffa0..06f406a 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -32,6 +32,7 @@
 #include <linux/io.h>
 #include <linux/gfp.h>
 #include <linux/clkdev.h>
+#include <linux/mtd/physmap.h>
 
 #include <asm/system.h>
 #include <asm/irq.h>
@@ -42,7 +43,6 @@
 #include <asm/mach-types.h>
 
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
 #include <asm/mach/map.h>
@@ -190,27 +190,7 @@ void __init versatile_map_io(void)
 
 #define VERSATILE_FLASHCTRL    (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET)
 
-static int versatile_flash_init(void)
-{
-	u32 val;
-
-	val = __raw_readl(VERSATILE_FLASHCTRL);
-	val &= ~VERSATILE_FLASHPROG_FLVPPEN;
-	__raw_writel(val, VERSATILE_FLASHCTRL);
-
-	return 0;
-}
-
-static void versatile_flash_exit(void)
-{
-	u32 val;
-
-	val = __raw_readl(VERSATILE_FLASHCTRL);
-	val &= ~VERSATILE_FLASHPROG_FLVPPEN;
-	__raw_writel(val, VERSATILE_FLASHCTRL);
-}
-
-static void versatile_flash_set_vpp(int on)
+static void versatile_flash_set_vpp(struct map_info *map, int on)
 {
 	u32 val;
 
@@ -222,11 +202,8 @@ static void versatile_flash_set_vpp(int on)
 	__raw_writel(val, VERSATILE_FLASHCTRL);
 }
 
-static struct flash_platform_data versatile_flash_data = {
-	.map_name		= "cfi_probe",
+static struct physmap_flash_data versatile_flash_data = {
 	.width			= 4,
-	.init			= versatile_flash_init,
-	.exit			= versatile_flash_exit,
 	.set_vpp		= versatile_flash_set_vpp,
 };
 
@@ -237,7 +214,7 @@ static struct resource versatile_flash_resource = {
 };
 
 static struct platform_device versatile_flash_device = {
-	.name			= "armflash",
+	.name			= "physmap-flash",
 	.id			= 0,
 	.dev			= {
 		.platform_data	= &versatile_flash_data,
-- 
1.7.0.4

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

* [PATCH v6 3/8] ARM: Versatile: Use physmap driver instead of integrator-flash
@ 2011-05-17 13:11   ` Marc Zyngier
  0 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 arch/arm/configs/versatile_defconfig |    2 +-
 arch/arm/mach-versatile/core.c       |   31 ++++---------------------------
 2 files changed, 5 insertions(+), 28 deletions(-)

diff --git a/arch/arm/configs/versatile_defconfig b/arch/arm/configs/versatile_defconfig
index 0ce710f..cdd4d2b 100644
--- a/arch/arm/configs/versatile_defconfig
+++ b/arch/arm/configs/versatile_defconfig
@@ -32,7 +32,7 @@ CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_ADV_OPTIONS=y
 CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_ARM_INTEGRATOR=y
+CONFIG_MTD_PHYSMAP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_EEPROM_LEGACY=m
 CONFIG_NETDEVICES=y
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index eb7ffa0..06f406a 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -32,6 +32,7 @@
 #include <linux/io.h>
 #include <linux/gfp.h>
 #include <linux/clkdev.h>
+#include <linux/mtd/physmap.h>
 
 #include <asm/system.h>
 #include <asm/irq.h>
@@ -42,7 +43,6 @@
 #include <asm/mach-types.h>
 
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
 #include <asm/mach/map.h>
@@ -190,27 +190,7 @@ void __init versatile_map_io(void)
 
 #define VERSATILE_FLASHCTRL    (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET)
 
-static int versatile_flash_init(void)
-{
-	u32 val;
-
-	val = __raw_readl(VERSATILE_FLASHCTRL);
-	val &= ~VERSATILE_FLASHPROG_FLVPPEN;
-	__raw_writel(val, VERSATILE_FLASHCTRL);
-
-	return 0;
-}
-
-static void versatile_flash_exit(void)
-{
-	u32 val;
-
-	val = __raw_readl(VERSATILE_FLASHCTRL);
-	val &= ~VERSATILE_FLASHPROG_FLVPPEN;
-	__raw_writel(val, VERSATILE_FLASHCTRL);
-}
-
-static void versatile_flash_set_vpp(int on)
+static void versatile_flash_set_vpp(struct map_info *map, int on)
 {
 	u32 val;
 
@@ -222,11 +202,8 @@ static void versatile_flash_set_vpp(int on)
 	__raw_writel(val, VERSATILE_FLASHCTRL);
 }
 
-static struct flash_platform_data versatile_flash_data = {
-	.map_name		= "cfi_probe",
+static struct physmap_flash_data versatile_flash_data = {
 	.width			= 4,
-	.init			= versatile_flash_init,
-	.exit			= versatile_flash_exit,
 	.set_vpp		= versatile_flash_set_vpp,
 };
 
@@ -237,7 +214,7 @@ static struct resource versatile_flash_resource = {
 };
 
 static struct platform_device versatile_flash_device = {
-	.name			= "armflash",
+	.name			= "physmap-flash",
 	.id			= 0,
 	.dev			= {
 		.platform_data	= &versatile_flash_data,
-- 
1.7.0.4

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

* [PATCH v6 4/8] ARM: VExpress: Use physmap driver instead of integrator-flash
  2011-05-17 13:11 ` Marc Zyngier
@ 2011-05-17 13:11   ` Marc Zyngier
  -1 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mtd; +Cc: David Woodhouse

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 arch/arm/mach-vexpress/v2m.c |   22 ++++------------------
 1 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index ba46e8e..e326815 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -13,11 +13,11 @@
 #include <linux/sysdev.h>
 #include <linux/usb/isp1760.h>
 #include <linux/clkdev.h>
+#include <linux/mtd/physmap.h>
 
 #include <asm/mach-types.h>
 #include <asm/sizes.h>
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
 #include <asm/hardware/arm_timer.h>
@@ -206,27 +206,13 @@ static struct platform_device v2m_usb_device = {
 	.dev.platform_data = &v2m_usb_config,
 };
 
-static int v2m_flash_init(void)
-{
-	writel(0, MMIO_P2V(V2M_SYS_FLASH));
-	return 0;
-}
-
-static void v2m_flash_exit(void)
-{
-	writel(0, MMIO_P2V(V2M_SYS_FLASH));
-}
-
-static void v2m_flash_set_vpp(int on)
+static void v2m_flash_set_vpp(struct map_info *map, int on)
 {
 	writel(on != 0, MMIO_P2V(V2M_SYS_FLASH));
 }
 
-static struct flash_platform_data v2m_flash_data = {
-	.map_name	= "cfi_probe",
+static struct physmap_flash_data v2m_flash_data = {
 	.width		= 4,
-	.init		= v2m_flash_init,
-	.exit		= v2m_flash_exit,
 	.set_vpp	= v2m_flash_set_vpp,
 };
 
@@ -243,7 +229,7 @@ static struct resource v2m_flash_resources[] = {
 };
 
 static struct platform_device v2m_flash_device = {
-	.name		= "armflash",
+	.name		= "physmap-flash",
 	.id		= -1,
 	.resource	= v2m_flash_resources,
 	.num_resources	= ARRAY_SIZE(v2m_flash_resources),
-- 
1.7.0.4

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

* [PATCH v6 4/8] ARM: VExpress: Use physmap driver instead of integrator-flash
@ 2011-05-17 13:11   ` Marc Zyngier
  0 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 arch/arm/mach-vexpress/v2m.c |   22 ++++------------------
 1 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index ba46e8e..e326815 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -13,11 +13,11 @@
 #include <linux/sysdev.h>
 #include <linux/usb/isp1760.h>
 #include <linux/clkdev.h>
+#include <linux/mtd/physmap.h>
 
 #include <asm/mach-types.h>
 #include <asm/sizes.h>
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
 #include <asm/hardware/arm_timer.h>
@@ -206,27 +206,13 @@ static struct platform_device v2m_usb_device = {
 	.dev.platform_data = &v2m_usb_config,
 };
 
-static int v2m_flash_init(void)
-{
-	writel(0, MMIO_P2V(V2M_SYS_FLASH));
-	return 0;
-}
-
-static void v2m_flash_exit(void)
-{
-	writel(0, MMIO_P2V(V2M_SYS_FLASH));
-}
-
-static void v2m_flash_set_vpp(int on)
+static void v2m_flash_set_vpp(struct map_info *map, int on)
 {
 	writel(on != 0, MMIO_P2V(V2M_SYS_FLASH));
 }
 
-static struct flash_platform_data v2m_flash_data = {
-	.map_name	= "cfi_probe",
+static struct physmap_flash_data v2m_flash_data = {
 	.width		= 4,
-	.init		= v2m_flash_init,
-	.exit		= v2m_flash_exit,
 	.set_vpp	= v2m_flash_set_vpp,
 };
 
@@ -243,7 +229,7 @@ static struct resource v2m_flash_resources[] = {
 };
 
 static struct platform_device v2m_flash_device = {
-	.name		= "armflash",
+	.name		= "physmap-flash",
 	.id		= -1,
 	.resource	= v2m_flash_resources,
 	.num_resources	= ARRAY_SIZE(v2m_flash_resources),
-- 
1.7.0.4

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

* [PATCH v6 5/8] ARM: Integrator/AP: Use physmap driver instead of integrator-flash
  2011-05-17 13:11 ` Marc Zyngier
@ 2011-05-17 13:11   ` Marc Zyngier
  -1 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mtd; +Cc: David Woodhouse

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 arch/arm/mach-integrator/integrator_ap.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 980803f..11bd49e 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -31,6 +31,7 @@
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
+#include <linux/mtd/physmap.h>
 
 #include <mach/hardware.h>
 #include <mach/platform.h>
@@ -43,7 +44,6 @@
 #include <mach/lm.h>
 
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
@@ -230,7 +230,7 @@ device_initcall(irq_init_sysfs);
 #define EBI_CSR1 (VA_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET)
 #define EBI_LOCK (VA_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET)
 
-static int ap_flash_init(void)
+static int ap_flash_init(struct platform_device *dev)
 {
 	u32 tmp;
 
@@ -247,7 +247,7 @@ static int ap_flash_init(void)
 	return 0;
 }
 
-static void ap_flash_exit(void)
+static void ap_flash_exit(struct platform_device *dev)
 {
 	u32 tmp;
 
@@ -263,15 +263,14 @@ static void ap_flash_exit(void)
 	}
 }
 
-static void ap_flash_set_vpp(int on)
+static void ap_flash_set_vpp(struct map_info *map, int on)
 {
 	void __iomem *reg = on ? SC_CTRLS : SC_CTRLC;
 
 	writel(INTEGRATOR_SC_CTRL_nFLVPPEN, reg);
 }
 
-static struct flash_platform_data ap_flash_data = {
-	.map_name	= "cfi_probe",
+static struct physmap_flash_data ap_flash_data = {
 	.width		= 4,
 	.init		= ap_flash_init,
 	.exit		= ap_flash_exit,
@@ -285,7 +284,7 @@ static struct resource cfi_flash_resource = {
 };
 
 static struct platform_device cfi_flash_device = {
-	.name		= "armflash",
+	.name		= "physmap-flash",
 	.id		= 0,
 	.dev		= {
 		.platform_data	= &ap_flash_data,
-- 
1.7.0.4

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

* [PATCH v6 5/8] ARM: Integrator/AP: Use physmap driver instead of integrator-flash
@ 2011-05-17 13:11   ` Marc Zyngier
  0 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 arch/arm/mach-integrator/integrator_ap.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 980803f..11bd49e 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -31,6 +31,7 @@
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
+#include <linux/mtd/physmap.h>
 
 #include <mach/hardware.h>
 #include <mach/platform.h>
@@ -43,7 +44,6 @@
 #include <mach/lm.h>
 
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
@@ -230,7 +230,7 @@ device_initcall(irq_init_sysfs);
 #define EBI_CSR1 (VA_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET)
 #define EBI_LOCK (VA_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET)
 
-static int ap_flash_init(void)
+static int ap_flash_init(struct platform_device *dev)
 {
 	u32 tmp;
 
@@ -247,7 +247,7 @@ static int ap_flash_init(void)
 	return 0;
 }
 
-static void ap_flash_exit(void)
+static void ap_flash_exit(struct platform_device *dev)
 {
 	u32 tmp;
 
@@ -263,15 +263,14 @@ static void ap_flash_exit(void)
 	}
 }
 
-static void ap_flash_set_vpp(int on)
+static void ap_flash_set_vpp(struct map_info *map, int on)
 {
 	void __iomem *reg = on ? SC_CTRLS : SC_CTRLC;
 
 	writel(INTEGRATOR_SC_CTRL_nFLVPPEN, reg);
 }
 
-static struct flash_platform_data ap_flash_data = {
-	.map_name	= "cfi_probe",
+static struct physmap_flash_data ap_flash_data = {
 	.width		= 4,
 	.init		= ap_flash_init,
 	.exit		= ap_flash_exit,
@@ -285,7 +284,7 @@ static struct resource cfi_flash_resource = {
 };
 
 static struct platform_device cfi_flash_device = {
-	.name		= "armflash",
+	.name		= "physmap-flash",
 	.id		= 0,
 	.dev		= {
 		.platform_data	= &ap_flash_data,
-- 
1.7.0.4

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

* [PATCH v6 6/8] ARM: Integrator/CP: Use physmap driver instead of integrator-flash
  2011-05-17 13:11 ` Marc Zyngier
@ 2011-05-17 13:11   ` Marc Zyngier
  -1 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mtd; +Cc: David Woodhouse

Tested with an ARM-1136 core tile.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 arch/arm/mach-integrator/integrator_cp.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 9e3ce26..ec9628f 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -22,6 +22,7 @@
 #include <linux/io.h>
 #include <linux/gfp.h>
 #include <linux/clkdev.h>
+#include <linux/mtd/physmap.h>
 
 #include <mach/hardware.h>
 #include <mach/platform.h>
@@ -35,7 +36,6 @@
 #include <mach/lm.h>
 
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
@@ -239,7 +239,7 @@ static struct clk_lookup cp_lookups[] = {
 /*
  * Flash handling.
  */
-static int intcp_flash_init(void)
+static int intcp_flash_init(struct platform_device *dev)
 {
 	u32 val;
 
@@ -250,7 +250,7 @@ static int intcp_flash_init(void)
 	return 0;
 }
 
-static void intcp_flash_exit(void)
+static void intcp_flash_exit(struct platform_device *dev)
 {
 	u32 val;
 
@@ -259,7 +259,7 @@ static void intcp_flash_exit(void)
 	writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
 }
 
-static void intcp_flash_set_vpp(int on)
+static void intcp_flash_set_vpp(struct map_info *map, int on)
 {
 	u32 val;
 
@@ -271,8 +271,7 @@ static void intcp_flash_set_vpp(int on)
 	writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
 }
 
-static struct flash_platform_data intcp_flash_data = {
-	.map_name	= "cfi_probe",
+static struct physmap_flash_data intcp_flash_data = {
 	.width		= 4,
 	.init		= intcp_flash_init,
 	.exit		= intcp_flash_exit,
@@ -286,7 +285,7 @@ static struct resource intcp_flash_resource = {
 };
 
 static struct platform_device intcp_flash_device = {
-	.name		= "armflash",
+	.name		= "physmap-flash",
 	.id		= 0,
 	.dev		= {
 		.platform_data	= &intcp_flash_data,
-- 
1.7.0.4

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

* [PATCH v6 6/8] ARM: Integrator/CP: Use physmap driver instead of integrator-flash
@ 2011-05-17 13:11   ` Marc Zyngier
  0 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel

Tested with an ARM-1136 core tile.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 arch/arm/mach-integrator/integrator_cp.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 9e3ce26..ec9628f 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -22,6 +22,7 @@
 #include <linux/io.h>
 #include <linux/gfp.h>
 #include <linux/clkdev.h>
+#include <linux/mtd/physmap.h>
 
 #include <mach/hardware.h>
 #include <mach/platform.h>
@@ -35,7 +36,6 @@
 #include <mach/lm.h>
 
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
@@ -239,7 +239,7 @@ static struct clk_lookup cp_lookups[] = {
 /*
  * Flash handling.
  */
-static int intcp_flash_init(void)
+static int intcp_flash_init(struct platform_device *dev)
 {
 	u32 val;
 
@@ -250,7 +250,7 @@ static int intcp_flash_init(void)
 	return 0;
 }
 
-static void intcp_flash_exit(void)
+static void intcp_flash_exit(struct platform_device *dev)
 {
 	u32 val;
 
@@ -259,7 +259,7 @@ static void intcp_flash_exit(void)
 	writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
 }
 
-static void intcp_flash_set_vpp(int on)
+static void intcp_flash_set_vpp(struct map_info *map, int on)
 {
 	u32 val;
 
@@ -271,8 +271,7 @@ static void intcp_flash_set_vpp(int on)
 	writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
 }
 
-static struct flash_platform_data intcp_flash_data = {
-	.map_name	= "cfi_probe",
+static struct physmap_flash_data intcp_flash_data = {
 	.width		= 4,
 	.init		= intcp_flash_init,
 	.exit		= intcp_flash_exit,
@@ -286,7 +285,7 @@ static struct resource intcp_flash_resource = {
 };
 
 static struct platform_device intcp_flash_device = {
-	.name		= "armflash",
+	.name		= "physmap-flash",
 	.id		= 0,
 	.dev		= {
 		.platform_data	= &intcp_flash_data,
-- 
1.7.0.4

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

* [PATCH v6 7/8] MTD: Remove integrator-flash
  2011-05-17 13:11 ` Marc Zyngier
@ 2011-05-17 13:11   ` Marc Zyngier
  -1 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mtd; +Cc: David Woodhouse

As there is now no in-tree user of integrator-flash, remove
it completely.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 drivers/mtd/Kconfig                 |    3 +-
 drivers/mtd/maps/Makefile           |    1 -
 drivers/mtd/maps/integrator-flash.c |  309 -----------------------------------
 3 files changed, 1 insertions(+), 312 deletions(-)
 delete mode 100644 drivers/mtd/maps/integrator-flash.c

diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index b4567c3..bc50d5e 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -148,8 +148,7 @@ config MTD_AFS_PARTS
 
 	  You will still need the parsing functions to be called by the driver
 	  for your particular device. It won't happen automatically. The
-	  'armflash' map driver (CONFIG_MTD_ARM_INTEGRATOR) does this, for
-	  example.
+	  'physmap' map driver (CONFIG_MTD_PHYSMAP) does this, for example.
 
 config MTD_OF_PARTS
 	def_bool y
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile
index 08533bd..5b5fa31 100644
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -8,7 +8,6 @@ endif
 
 # Chip mappings
 obj-$(CONFIG_MTD_CDB89712)	+= cdb89712.o
-obj-$(CONFIG_MTD_ARM_INTEGRATOR)+= integrator-flash.o
 obj-$(CONFIG_MTD_CFI_FLAGADM)	+= cfi_flagadm.o
 obj-$(CONFIG_MTD_DC21285)	+= dc21285.o
 obj-$(CONFIG_MTD_DILNETPC)	+= dilnetpc.o
diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c
deleted file mode 100644
index e22ff5a..0000000
--- a/drivers/mtd/maps/integrator-flash.c
+++ /dev/null
@@ -1,309 +0,0 @@
-/*======================================================================
-
-    drivers/mtd/maps/integrator-flash.c: ARM Integrator flash map driver
-
-    Copyright (C) 2000 ARM Limited
-    Copyright (C) 2003 Deep Blue Solutions Ltd.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-   This is access code for flashes using ARM's flash partitioning
-   standards.
-
-======================================================================*/
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/ioport.h>
-#include <linux/platform_device.h>
-#include <linux/init.h>
-#include <linux/io.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/map.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/concat.h>
-
-#include <asm/mach/flash.h>
-#include <mach/hardware.h>
-#include <asm/system.h>
-
-struct armflash_subdev_info {
-	char			*name;
-	struct mtd_info		*mtd;
-	struct map_info		map;
-	struct flash_platform_data *plat;
-};
-
-struct armflash_info {
-	struct resource		*res;
-	struct mtd_partition	*parts;
-	struct mtd_info		*mtd;
-	int			nr_subdev;
-	struct armflash_subdev_info subdev[0];
-};
-
-static void armflash_set_vpp(struct map_info *map, int on)
-{
-	struct armflash_subdev_info *info =
-		container_of(map, struct armflash_subdev_info, map);
-
-	if (info->plat && info->plat->set_vpp)
-		info->plat->set_vpp(on);
-}
-
-static const char *probes[] = { "cmdlinepart", "RedBoot", "afs", NULL };
-
-static int armflash_subdev_probe(struct armflash_subdev_info *subdev,
-				 struct resource *res)
-{
-	struct flash_platform_data *plat = subdev->plat;
-	resource_size_t size = res->end - res->start + 1;
-	void __iomem *base;
-	int err = 0;
-
-	if (!request_mem_region(res->start, size, subdev->name)) {
-		err = -EBUSY;
-		goto out;
-	}
-
-	base = ioremap(res->start, size);
-	if (!base) {
-		err = -ENOMEM;
-		goto no_mem;
-	}
-
-	/*
-	 * look for CFI based flash parts fitted to this board
-	 */
-	subdev->map.size	= size;
-	subdev->map.bankwidth	= plat->width;
-	subdev->map.phys	= res->start;
-	subdev->map.virt	= base;
-	subdev->map.name	= subdev->name;
-	subdev->map.set_vpp	= armflash_set_vpp;
-
-	simple_map_init(&subdev->map);
-
-	/*
-	 * Also, the CFI layer automatically works out what size
-	 * of chips we have, and does the necessary identification
-	 * for us automatically.
-	 */
-	subdev->mtd = do_map_probe(plat->map_name, &subdev->map);
-	if (!subdev->mtd) {
-		err = -ENXIO;
-		goto no_device;
-	}
-
-	subdev->mtd->owner = THIS_MODULE;
-
-	/* Successful? */
-	if (err == 0)
-		return err;
-
-	if (subdev->mtd)
-		map_destroy(subdev->mtd);
- no_device:
-	iounmap(base);
- no_mem:
-	release_mem_region(res->start, size);
- out:
-	return err;
-}
-
-static void armflash_subdev_remove(struct armflash_subdev_info *subdev)
-{
-	if (subdev->mtd)
-		map_destroy(subdev->mtd);
-	if (subdev->map.virt)
-		iounmap(subdev->map.virt);
-	kfree(subdev->name);
-	subdev->name = NULL;
-	release_mem_region(subdev->map.phys, subdev->map.size);
-}
-
-static int armflash_probe(struct platform_device *dev)
-{
-	struct flash_platform_data *plat = dev->dev.platform_data;
-	unsigned int size;
-	struct armflash_info *info;
-	int i, nr, err;
-
-	/* Count the number of devices */
-	for (nr = 0; ; nr++)
-		if (!platform_get_resource(dev, IORESOURCE_MEM, nr))
-			break;
-	if (nr == 0) {
-		err = -ENODEV;
-		goto out;
-	}
-
-	size = sizeof(struct armflash_info) +
-		sizeof(struct armflash_subdev_info) * nr;
-	info = kzalloc(size, GFP_KERNEL);
-	if (!info) {
-		err = -ENOMEM;
-		goto out;
-	}
-
-	if (plat && plat->init) {
-		err = plat->init();
-		if (err)
-			goto no_resource;
-	}
-
-	for (i = 0; i < nr; i++) {
-		struct armflash_subdev_info *subdev = &info->subdev[i];
-		struct resource *res;
-
-		res = platform_get_resource(dev, IORESOURCE_MEM, i);
-		if (!res)
-			break;
-
-		if (nr == 1)
-			/* No MTD concatenation, just use the default name */
-			subdev->name = kstrdup(dev_name(&dev->dev), GFP_KERNEL);
-		else
-			subdev->name = kasprintf(GFP_KERNEL, "%s-%d",
-						 dev_name(&dev->dev), i);
-		if (!subdev->name) {
-			err = -ENOMEM;
-			break;
-		}
-		subdev->plat = plat;
-
-		err = armflash_subdev_probe(subdev, res);
-		if (err) {
-			kfree(subdev->name);
-			subdev->name = NULL;
-			break;
-		}
-	}
-	info->nr_subdev = i;
-
-	if (err)
-		goto subdev_err;
-
-	if (info->nr_subdev == 1)
-		info->mtd = info->subdev[0].mtd;
-	else if (info->nr_subdev > 1) {
-		struct mtd_info *cdev[info->nr_subdev];
-
-		/*
-		 * We detected multiple devices.  Concatenate them together.
-		 */
-		for (i = 0; i < info->nr_subdev; i++)
-			cdev[i] = info->subdev[i].mtd;
-
-		info->mtd = mtd_concat_create(cdev, info->nr_subdev,
-					      dev_name(&dev->dev));
-		if (info->mtd == NULL)
-			err = -ENXIO;
-	}
-
-	if (err < 0)
-		goto cleanup;
-
-	err = parse_mtd_partitions(info->mtd, probes, &info->parts, 0);
-	if (err > 0) {
-		err = add_mtd_partitions(info->mtd, info->parts, err);
-		if (err)
-			printk(KERN_ERR
-			       "mtd partition registration failed: %d\n", err);
-	}
-
-	if (err == 0) {
-		platform_set_drvdata(dev, info);
-		return err;
-	}
-
-	/*
-	 * We got an error, free all resources.
-	 */
- cleanup:
-	if (info->mtd) {
-		del_mtd_partitions(info->mtd);
-		if (info->mtd != info->subdev[0].mtd)
-			mtd_concat_destroy(info->mtd);
-	}
-	kfree(info->parts);
- subdev_err:
-	for (i = info->nr_subdev - 1; i >= 0; i--)
-		armflash_subdev_remove(&info->subdev[i]);
- no_resource:
-	if (plat && plat->exit)
-		plat->exit();
-	kfree(info);
- out:
-	return err;
-}
-
-static int armflash_remove(struct platform_device *dev)
-{
-	struct armflash_info *info = platform_get_drvdata(dev);
-	struct flash_platform_data *plat = dev->dev.platform_data;
-	int i;
-
-	platform_set_drvdata(dev, NULL);
-
-	if (info) {
-		if (info->mtd) {
-			del_mtd_partitions(info->mtd);
-			if (info->mtd != info->subdev[0].mtd)
-				mtd_concat_destroy(info->mtd);
-		}
-		kfree(info->parts);
-
-		for (i = info->nr_subdev - 1; i >= 0; i--)
-			armflash_subdev_remove(&info->subdev[i]);
-
-		if (plat && plat->exit)
-			plat->exit();
-
-		kfree(info);
-	}
-
-	return 0;
-}
-
-static struct platform_driver armflash_driver = {
-	.probe		= armflash_probe,
-	.remove		= armflash_remove,
-	.driver		= {
-		.name	= "armflash",
-		.owner	= THIS_MODULE,
-	},
-};
-
-static int __init armflash_init(void)
-{
-	return platform_driver_register(&armflash_driver);
-}
-
-static void __exit armflash_exit(void)
-{
-	platform_driver_unregister(&armflash_driver);
-}
-
-module_init(armflash_init);
-module_exit(armflash_exit);
-
-MODULE_AUTHOR("ARM Ltd");
-MODULE_DESCRIPTION("ARM Integrator CFI map driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:armflash");
-- 
1.7.0.4

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

* [PATCH v6 7/8] MTD: Remove integrator-flash
@ 2011-05-17 13:11   ` Marc Zyngier
  0 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel

As there is now no in-tree user of integrator-flash, remove
it completely.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
---
 drivers/mtd/Kconfig                 |    3 +-
 drivers/mtd/maps/Makefile           |    1 -
 drivers/mtd/maps/integrator-flash.c |  309 -----------------------------------
 3 files changed, 1 insertions(+), 312 deletions(-)
 delete mode 100644 drivers/mtd/maps/integrator-flash.c

diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index b4567c3..bc50d5e 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -148,8 +148,7 @@ config MTD_AFS_PARTS
 
 	  You will still need the parsing functions to be called by the driver
 	  for your particular device. It won't happen automatically. The
-	  'armflash' map driver (CONFIG_MTD_ARM_INTEGRATOR) does this, for
-	  example.
+	  'physmap' map driver (CONFIG_MTD_PHYSMAP) does this, for example.
 
 config MTD_OF_PARTS
 	def_bool y
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile
index 08533bd..5b5fa31 100644
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -8,7 +8,6 @@ endif
 
 # Chip mappings
 obj-$(CONFIG_MTD_CDB89712)	+= cdb89712.o
-obj-$(CONFIG_MTD_ARM_INTEGRATOR)+= integrator-flash.o
 obj-$(CONFIG_MTD_CFI_FLAGADM)	+= cfi_flagadm.o
 obj-$(CONFIG_MTD_DC21285)	+= dc21285.o
 obj-$(CONFIG_MTD_DILNETPC)	+= dilnetpc.o
diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c
deleted file mode 100644
index e22ff5a..0000000
--- a/drivers/mtd/maps/integrator-flash.c
+++ /dev/null
@@ -1,309 +0,0 @@
-/*======================================================================
-
-    drivers/mtd/maps/integrator-flash.c: ARM Integrator flash map driver
-
-    Copyright (C) 2000 ARM Limited
-    Copyright (C) 2003 Deep Blue Solutions Ltd.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-   This is access code for flashes using ARM's flash partitioning
-   standards.
-
-======================================================================*/
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/ioport.h>
-#include <linux/platform_device.h>
-#include <linux/init.h>
-#include <linux/io.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/map.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/concat.h>
-
-#include <asm/mach/flash.h>
-#include <mach/hardware.h>
-#include <asm/system.h>
-
-struct armflash_subdev_info {
-	char			*name;
-	struct mtd_info		*mtd;
-	struct map_info		map;
-	struct flash_platform_data *plat;
-};
-
-struct armflash_info {
-	struct resource		*res;
-	struct mtd_partition	*parts;
-	struct mtd_info		*mtd;
-	int			nr_subdev;
-	struct armflash_subdev_info subdev[0];
-};
-
-static void armflash_set_vpp(struct map_info *map, int on)
-{
-	struct armflash_subdev_info *info =
-		container_of(map, struct armflash_subdev_info, map);
-
-	if (info->plat && info->plat->set_vpp)
-		info->plat->set_vpp(on);
-}
-
-static const char *probes[] = { "cmdlinepart", "RedBoot", "afs", NULL };
-
-static int armflash_subdev_probe(struct armflash_subdev_info *subdev,
-				 struct resource *res)
-{
-	struct flash_platform_data *plat = subdev->plat;
-	resource_size_t size = res->end - res->start + 1;
-	void __iomem *base;
-	int err = 0;
-
-	if (!request_mem_region(res->start, size, subdev->name)) {
-		err = -EBUSY;
-		goto out;
-	}
-
-	base = ioremap(res->start, size);
-	if (!base) {
-		err = -ENOMEM;
-		goto no_mem;
-	}
-
-	/*
-	 * look for CFI based flash parts fitted to this board
-	 */
-	subdev->map.size	= size;
-	subdev->map.bankwidth	= plat->width;
-	subdev->map.phys	= res->start;
-	subdev->map.virt	= base;
-	subdev->map.name	= subdev->name;
-	subdev->map.set_vpp	= armflash_set_vpp;
-
-	simple_map_init(&subdev->map);
-
-	/*
-	 * Also, the CFI layer automatically works out what size
-	 * of chips we have, and does the necessary identification
-	 * for us automatically.
-	 */
-	subdev->mtd = do_map_probe(plat->map_name, &subdev->map);
-	if (!subdev->mtd) {
-		err = -ENXIO;
-		goto no_device;
-	}
-
-	subdev->mtd->owner = THIS_MODULE;
-
-	/* Successful? */
-	if (err == 0)
-		return err;
-
-	if (subdev->mtd)
-		map_destroy(subdev->mtd);
- no_device:
-	iounmap(base);
- no_mem:
-	release_mem_region(res->start, size);
- out:
-	return err;
-}
-
-static void armflash_subdev_remove(struct armflash_subdev_info *subdev)
-{
-	if (subdev->mtd)
-		map_destroy(subdev->mtd);
-	if (subdev->map.virt)
-		iounmap(subdev->map.virt);
-	kfree(subdev->name);
-	subdev->name = NULL;
-	release_mem_region(subdev->map.phys, subdev->map.size);
-}
-
-static int armflash_probe(struct platform_device *dev)
-{
-	struct flash_platform_data *plat = dev->dev.platform_data;
-	unsigned int size;
-	struct armflash_info *info;
-	int i, nr, err;
-
-	/* Count the number of devices */
-	for (nr = 0; ; nr++)
-		if (!platform_get_resource(dev, IORESOURCE_MEM, nr))
-			break;
-	if (nr == 0) {
-		err = -ENODEV;
-		goto out;
-	}
-
-	size = sizeof(struct armflash_info) +
-		sizeof(struct armflash_subdev_info) * nr;
-	info = kzalloc(size, GFP_KERNEL);
-	if (!info) {
-		err = -ENOMEM;
-		goto out;
-	}
-
-	if (plat && plat->init) {
-		err = plat->init();
-		if (err)
-			goto no_resource;
-	}
-
-	for (i = 0; i < nr; i++) {
-		struct armflash_subdev_info *subdev = &info->subdev[i];
-		struct resource *res;
-
-		res = platform_get_resource(dev, IORESOURCE_MEM, i);
-		if (!res)
-			break;
-
-		if (nr == 1)
-			/* No MTD concatenation, just use the default name */
-			subdev->name = kstrdup(dev_name(&dev->dev), GFP_KERNEL);
-		else
-			subdev->name = kasprintf(GFP_KERNEL, "%s-%d",
-						 dev_name(&dev->dev), i);
-		if (!subdev->name) {
-			err = -ENOMEM;
-			break;
-		}
-		subdev->plat = plat;
-
-		err = armflash_subdev_probe(subdev, res);
-		if (err) {
-			kfree(subdev->name);
-			subdev->name = NULL;
-			break;
-		}
-	}
-	info->nr_subdev = i;
-
-	if (err)
-		goto subdev_err;
-
-	if (info->nr_subdev == 1)
-		info->mtd = info->subdev[0].mtd;
-	else if (info->nr_subdev > 1) {
-		struct mtd_info *cdev[info->nr_subdev];
-
-		/*
-		 * We detected multiple devices.  Concatenate them together.
-		 */
-		for (i = 0; i < info->nr_subdev; i++)
-			cdev[i] = info->subdev[i].mtd;
-
-		info->mtd = mtd_concat_create(cdev, info->nr_subdev,
-					      dev_name(&dev->dev));
-		if (info->mtd == NULL)
-			err = -ENXIO;
-	}
-
-	if (err < 0)
-		goto cleanup;
-
-	err = parse_mtd_partitions(info->mtd, probes, &info->parts, 0);
-	if (err > 0) {
-		err = add_mtd_partitions(info->mtd, info->parts, err);
-		if (err)
-			printk(KERN_ERR
-			       "mtd partition registration failed: %d\n", err);
-	}
-
-	if (err == 0) {
-		platform_set_drvdata(dev, info);
-		return err;
-	}
-
-	/*
-	 * We got an error, free all resources.
-	 */
- cleanup:
-	if (info->mtd) {
-		del_mtd_partitions(info->mtd);
-		if (info->mtd != info->subdev[0].mtd)
-			mtd_concat_destroy(info->mtd);
-	}
-	kfree(info->parts);
- subdev_err:
-	for (i = info->nr_subdev - 1; i >= 0; i--)
-		armflash_subdev_remove(&info->subdev[i]);
- no_resource:
-	if (plat && plat->exit)
-		plat->exit();
-	kfree(info);
- out:
-	return err;
-}
-
-static int armflash_remove(struct platform_device *dev)
-{
-	struct armflash_info *info = platform_get_drvdata(dev);
-	struct flash_platform_data *plat = dev->dev.platform_data;
-	int i;
-
-	platform_set_drvdata(dev, NULL);
-
-	if (info) {
-		if (info->mtd) {
-			del_mtd_partitions(info->mtd);
-			if (info->mtd != info->subdev[0].mtd)
-				mtd_concat_destroy(info->mtd);
-		}
-		kfree(info->parts);
-
-		for (i = info->nr_subdev - 1; i >= 0; i--)
-			armflash_subdev_remove(&info->subdev[i]);
-
-		if (plat && plat->exit)
-			plat->exit();
-
-		kfree(info);
-	}
-
-	return 0;
-}
-
-static struct platform_driver armflash_driver = {
-	.probe		= armflash_probe,
-	.remove		= armflash_remove,
-	.driver		= {
-		.name	= "armflash",
-		.owner	= THIS_MODULE,
-	},
-};
-
-static int __init armflash_init(void)
-{
-	return platform_driver_register(&armflash_driver);
-}
-
-static void __exit armflash_exit(void)
-{
-	platform_driver_unregister(&armflash_driver);
-}
-
-module_init(armflash_init);
-module_exit(armflash_exit);
-
-MODULE_AUTHOR("ARM Ltd");
-MODULE_DESCRIPTION("ARM Integrator CFI map driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:armflash");
-- 
1.7.0.4

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

* [PATCH v6 8/8] MTD: physmap: let set_vpp() pass a platform_device instead of a map_info
  2011-05-17 13:11 ` Marc Zyngier
@ 2011-05-17 13:11   ` Marc Zyngier
  -1 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel, linux-mtd
  Cc: Eric Miao, Ben Dooks, David Woodhouse, Nicolas Ferre,
	Philipp Zabel, Russell King, Jean-Christophe Plagniol-Villard,
	Andrew Victor

The set_vpp() method provided by physmap passes a map_info back to
the platform code, which has little relevance as far as the platform
is concerned (this parameter is completely unused).

Instead, pass the platform_device, which can be used in the pismo
driver to retrieve some important information in a nicer way, instead
of the hack that was in place.

The empty set_vpp function in board-at572d940hf_ek.c is left untouched,
as the board/SoC is scheduled for removal.

Cc: Andrew Victor <linux@maxim.org.za>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/mach-integrator/integrator_ap.c |    2 +-
 arch/arm/mach-integrator/integrator_cp.c |    2 +-
 arch/arm/mach-omap1/flash.c              |    2 +-
 arch/arm/mach-pxa/hx4700.c               |    2 +-
 arch/arm/mach-pxa/magician.c             |    2 +-
 arch/arm/mach-realview/core.c            |    2 +-
 arch/arm/mach-s3c2410/nor-simtec.c       |    2 +-
 arch/arm/mach-versatile/core.c           |    2 +-
 arch/arm/mach-vexpress/v2m.c             |    2 +-
 arch/arm/plat-omap/include/plat/flash.h  |    2 +-
 drivers/mtd/maps/physmap.c               |   20 +++++++++++---
 drivers/mtd/maps/pismo.c                 |   40 ++---------------------------
 include/linux/mtd/physmap.h              |    2 +-
 13 files changed, 29 insertions(+), 53 deletions(-)

diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 11bd49e..2aa98ee 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -263,7 +263,7 @@ static void ap_flash_exit(struct platform_device *dev)
 	}
 }
 
-static void ap_flash_set_vpp(struct map_info *map, int on)
+static void ap_flash_set_vpp(struct platform_device *pdev, int on)
 {
 	void __iomem *reg = on ? SC_CTRLS : SC_CTRLC;
 
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index ec9628f..b676b41 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -259,7 +259,7 @@ static void intcp_flash_exit(struct platform_device *dev)
 	writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
 }
 
-static void intcp_flash_set_vpp(struct map_info *map, int on)
+static void intcp_flash_set_vpp(struct platform_device *pdev, int on)
 {
 	u32 val;
 
diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c
index acd1616..1749cb3 100644
--- a/arch/arm/mach-omap1/flash.c
+++ b/arch/arm/mach-omap1/flash.c
@@ -13,7 +13,7 @@
 #include <plat/tc.h>
 #include <plat/flash.h>
 
-void omap1_set_vpp(struct map_info *map, int enable)
+void omap1_set_vpp(struct platform_device *pdev, int enable)
 {
 	static int count;
 	u32 l;
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index 9cdcca5..f941a49 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -735,7 +735,7 @@ static struct platform_device bq24022 = {
  * StrataFlash
  */
 
-static void hx4700_set_vpp(struct map_info *map, int vpp)
+static void hx4700_set_vpp(struct platform_device *pdev, int vpp)
 {
 	gpio_set_value(GPIO91_HX4700_FLASH_VPEN, vpp);
 }
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 9984ef7..e192057 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -662,7 +662,7 @@ static struct pxaohci_platform_data magician_ohci_info = {
  * StrataFlash
  */
 
-static void magician_set_vpp(struct map_info *map, int vpp)
+static void magician_set_vpp(struct platform_device *pdev, int vpp)
 {
 	gpio_set_value(EGPIO_MAGICIAN_FLASH_VPP, vpp);
 }
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index d3f1dde..c8ec088 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -77,7 +77,7 @@ void __init realview_adjust_zones(unsigned long *size, unsigned long *hole)
 
 #define REALVIEW_FLASHCTRL    (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET)
 
-static void realview_flash_set_vpp(struct map_info *map, int on)
+static void realview_flash_set_vpp(struct platform_device *pdev, int on)
 {
 	u32 val;
 
diff --git a/arch/arm/mach-s3c2410/nor-simtec.c b/arch/arm/mach-s3c2410/nor-simtec.c
index 598d130..ad9f750 100644
--- a/arch/arm/mach-s3c2410/nor-simtec.c
+++ b/arch/arm/mach-s3c2410/nor-simtec.c
@@ -32,7 +32,7 @@
 
 #include "nor-simtec.h"
 
-static void simtec_nor_vpp(struct map_info *map, int vpp)
+static void simtec_nor_vpp(struct platform_device *pdev, int vpp)
 {
 	unsigned int val;
 	unsigned long flags;
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 06f406a..335d825 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -190,7 +190,7 @@ void __init versatile_map_io(void)
 
 #define VERSATILE_FLASHCTRL    (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET)
 
-static void versatile_flash_set_vpp(struct map_info *map, int on)
+static void versatile_flash_set_vpp(struct platform_device *pdev, int on)
 {
 	u32 val;
 
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index e326815..f860314 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -206,7 +206,7 @@ static struct platform_device v2m_usb_device = {
 	.dev.platform_data = &v2m_usb_config,
 };
 
-static void v2m_flash_set_vpp(struct map_info *map, int on)
+static void v2m_flash_set_vpp(struct platform_device *pdev, int on)
 {
 	writel(on != 0, MMIO_P2V(V2M_SYS_FLASH));
 }
diff --git a/arch/arm/plat-omap/include/plat/flash.h b/arch/arm/plat-omap/include/plat/flash.h
index 3e63270..3083195 100644
--- a/arch/arm/plat-omap/include/plat/flash.h
+++ b/arch/arm/plat-omap/include/plat/flash.h
@@ -11,6 +11,6 @@
 
 #include <linux/mtd/map.h>
 
-extern void omap1_set_vpp(struct map_info *map, int enable);
+extern void omap1_set_vpp(struct platform_device *pdev, int enable);
 
 #endif
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index 49676b7..1a9b94f 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -74,6 +74,18 @@ static int physmap_flash_remove(struct platform_device *dev)
 	return 0;
 }
 
+static void physmap_set_vpp(struct map_info *map, int state)
+{
+	struct platform_device *pdev;
+	struct physmap_flash_data *physmap_data;
+
+	pdev = (struct platform_device *)map->map_priv_1;
+	physmap_data = pdev->dev.platform_data;
+
+	if (physmap_data->set_vpp)
+		physmap_data->set_vpp(pdev, state);
+}
+
 static const char *rom_probe_types[] = {
 					"cfi_probe",
 					"jedec_probe",
@@ -81,10 +93,7 @@ static const char *rom_probe_types[] = {
 					"map_rom",
 					NULL };
 #ifdef CONFIG_MTD_PARTITIONS
-static const char *part_probe_types[] = { "cmdlinepart", "RedBoot",
-#ifdef CONFIG_MTD_AFS_PARTS
-					  "afs",
-#endif
+static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", "afs",
 					  NULL };
 #endif
 
@@ -134,8 +143,9 @@ static int physmap_flash_probe(struct platform_device *dev)
 		info->map[i].phys = dev->resource[i].start;
 		info->map[i].size = resource_size(&dev->resource[i]);
 		info->map[i].bankwidth = physmap_data->width;
-		info->map[i].set_vpp = physmap_data->set_vpp;
+		info->map[i].set_vpp = physmap_set_vpp;
 		info->map[i].pfow_base = physmap_data->pfow_base;
+		info->map[i].map_priv_1 = (unsigned long)dev;
 
 		info->map[i].virt = devm_ioremap(&dev->dev, info->map[i].phys,
 						 info->map[i].size);
diff --git a/drivers/mtd/maps/pismo.c b/drivers/mtd/maps/pismo.c
index f4ce273..65bd1cd 100644
--- a/drivers/mtd/maps/pismo.c
+++ b/drivers/mtd/maps/pismo.c
@@ -50,39 +50,13 @@ struct pismo_data {
 	struct platform_device	*dev[PISMO_NUM_CS];
 };
 
-/* FIXME: set_vpp could do with a better calling convention */
-static struct pismo_data *vpp_pismo;
-static DEFINE_MUTEX(pismo_mutex);
-
-static int pismo_setvpp_probe_fix(struct pismo_data *pismo)
+static void pismo_set_vpp(struct platform_device *pdev, int on)
 {
-	mutex_lock(&pismo_mutex);
-	if (vpp_pismo) {
-		mutex_unlock(&pismo_mutex);
-		kfree(pismo);
-		return -EBUSY;
-	}
-	vpp_pismo = pismo;
-	mutex_unlock(&pismo_mutex);
-	return 0;
-}
-
-static void pismo_setvpp_remove_fix(struct pismo_data *pismo)
-{
-	mutex_lock(&pismo_mutex);
-	if (vpp_pismo == pismo)
-		vpp_pismo = NULL;
-	mutex_unlock(&pismo_mutex);
-}
-
-static void pismo_set_vpp(struct map_info *map, int on)
-{
-	struct pismo_data *pismo = vpp_pismo;
+	struct i2c_client *client = to_i2c_client(pdev->dev.parent);
+	struct pismo_data *pismo = i2c_get_clientdata(client);
 
 	pismo->vpp(pismo->vpp_data, on);
 }
-/* end of hack */
-
 
 static unsigned int __devinit pismo_width_to_bytes(unsigned int width)
 {
@@ -231,9 +205,6 @@ static int __devexit pismo_remove(struct i2c_client *client)
 	for (i = 0; i < ARRAY_SIZE(pismo->dev); i++)
 		platform_device_unregister(pismo->dev[i]);
 
-	/* FIXME: set_vpp needs saner arguments */
-	pismo_setvpp_remove_fix(pismo);
-
 	kfree(pismo);
 
 	return 0;
@@ -257,11 +228,6 @@ static int __devinit pismo_probe(struct i2c_client *client,
 	if (!pismo)
 		return -ENOMEM;
 
-	/* FIXME: set_vpp needs saner arguments */
-	ret = pismo_setvpp_probe_fix(pismo);
-	if (ret)
-		return ret;
-
 	pismo->client = client;
 	if (pdata) {
 		pismo->vpp = pdata->set_vpp;
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index d37cca0..49b9590 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -24,7 +24,7 @@ struct physmap_flash_data {
 	unsigned int		width;
 	int			(*init)(struct platform_device *);
 	void			(*exit)(struct platform_device *);
-	void			(*set_vpp)(struct map_info *, int);
+	void			(*set_vpp)(struct platform_device *, int);
 	unsigned int		nr_parts;
 	unsigned int		pfow_base;
 	char                    *probe_type;
-- 
1.7.0.4

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

* [PATCH v6 8/8] MTD: physmap: let set_vpp() pass a platform_device instead of a map_info
@ 2011-05-17 13:11   ` Marc Zyngier
  0 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-17 13:11 UTC (permalink / raw)
  To: linux-arm-kernel

The set_vpp() method provided by physmap passes a map_info back to
the platform code, which has little relevance as far as the platform
is concerned (this parameter is completely unused).

Instead, pass the platform_device, which can be used in the pismo
driver to retrieve some important information in a nicer way, instead
of the hack that was in place.

The empty set_vpp function in board-at572d940hf_ek.c is left untouched,
as the board/SoC is scheduled for removal.

Cc: Andrew Victor <linux@maxim.org.za>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/mach-integrator/integrator_ap.c |    2 +-
 arch/arm/mach-integrator/integrator_cp.c |    2 +-
 arch/arm/mach-omap1/flash.c              |    2 +-
 arch/arm/mach-pxa/hx4700.c               |    2 +-
 arch/arm/mach-pxa/magician.c             |    2 +-
 arch/arm/mach-realview/core.c            |    2 +-
 arch/arm/mach-s3c2410/nor-simtec.c       |    2 +-
 arch/arm/mach-versatile/core.c           |    2 +-
 arch/arm/mach-vexpress/v2m.c             |    2 +-
 arch/arm/plat-omap/include/plat/flash.h  |    2 +-
 drivers/mtd/maps/physmap.c               |   20 +++++++++++---
 drivers/mtd/maps/pismo.c                 |   40 ++---------------------------
 include/linux/mtd/physmap.h              |    2 +-
 13 files changed, 29 insertions(+), 53 deletions(-)

diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 11bd49e..2aa98ee 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -263,7 +263,7 @@ static void ap_flash_exit(struct platform_device *dev)
 	}
 }
 
-static void ap_flash_set_vpp(struct map_info *map, int on)
+static void ap_flash_set_vpp(struct platform_device *pdev, int on)
 {
 	void __iomem *reg = on ? SC_CTRLS : SC_CTRLC;
 
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index ec9628f..b676b41 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -259,7 +259,7 @@ static void intcp_flash_exit(struct platform_device *dev)
 	writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
 }
 
-static void intcp_flash_set_vpp(struct map_info *map, int on)
+static void intcp_flash_set_vpp(struct platform_device *pdev, int on)
 {
 	u32 val;
 
diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c
index acd1616..1749cb3 100644
--- a/arch/arm/mach-omap1/flash.c
+++ b/arch/arm/mach-omap1/flash.c
@@ -13,7 +13,7 @@
 #include <plat/tc.h>
 #include <plat/flash.h>
 
-void omap1_set_vpp(struct map_info *map, int enable)
+void omap1_set_vpp(struct platform_device *pdev, int enable)
 {
 	static int count;
 	u32 l;
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index 9cdcca5..f941a49 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -735,7 +735,7 @@ static struct platform_device bq24022 = {
  * StrataFlash
  */
 
-static void hx4700_set_vpp(struct map_info *map, int vpp)
+static void hx4700_set_vpp(struct platform_device *pdev, int vpp)
 {
 	gpio_set_value(GPIO91_HX4700_FLASH_VPEN, vpp);
 }
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 9984ef7..e192057 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -662,7 +662,7 @@ static struct pxaohci_platform_data magician_ohci_info = {
  * StrataFlash
  */
 
-static void magician_set_vpp(struct map_info *map, int vpp)
+static void magician_set_vpp(struct platform_device *pdev, int vpp)
 {
 	gpio_set_value(EGPIO_MAGICIAN_FLASH_VPP, vpp);
 }
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index d3f1dde..c8ec088 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -77,7 +77,7 @@ void __init realview_adjust_zones(unsigned long *size, unsigned long *hole)
 
 #define REALVIEW_FLASHCTRL    (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET)
 
-static void realview_flash_set_vpp(struct map_info *map, int on)
+static void realview_flash_set_vpp(struct platform_device *pdev, int on)
 {
 	u32 val;
 
diff --git a/arch/arm/mach-s3c2410/nor-simtec.c b/arch/arm/mach-s3c2410/nor-simtec.c
index 598d130..ad9f750 100644
--- a/arch/arm/mach-s3c2410/nor-simtec.c
+++ b/arch/arm/mach-s3c2410/nor-simtec.c
@@ -32,7 +32,7 @@
 
 #include "nor-simtec.h"
 
-static void simtec_nor_vpp(struct map_info *map, int vpp)
+static void simtec_nor_vpp(struct platform_device *pdev, int vpp)
 {
 	unsigned int val;
 	unsigned long flags;
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 06f406a..335d825 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -190,7 +190,7 @@ void __init versatile_map_io(void)
 
 #define VERSATILE_FLASHCTRL    (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET)
 
-static void versatile_flash_set_vpp(struct map_info *map, int on)
+static void versatile_flash_set_vpp(struct platform_device *pdev, int on)
 {
 	u32 val;
 
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index e326815..f860314 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -206,7 +206,7 @@ static struct platform_device v2m_usb_device = {
 	.dev.platform_data = &v2m_usb_config,
 };
 
-static void v2m_flash_set_vpp(struct map_info *map, int on)
+static void v2m_flash_set_vpp(struct platform_device *pdev, int on)
 {
 	writel(on != 0, MMIO_P2V(V2M_SYS_FLASH));
 }
diff --git a/arch/arm/plat-omap/include/plat/flash.h b/arch/arm/plat-omap/include/plat/flash.h
index 3e63270..3083195 100644
--- a/arch/arm/plat-omap/include/plat/flash.h
+++ b/arch/arm/plat-omap/include/plat/flash.h
@@ -11,6 +11,6 @@
 
 #include <linux/mtd/map.h>
 
-extern void omap1_set_vpp(struct map_info *map, int enable);
+extern void omap1_set_vpp(struct platform_device *pdev, int enable);
 
 #endif
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index 49676b7..1a9b94f 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -74,6 +74,18 @@ static int physmap_flash_remove(struct platform_device *dev)
 	return 0;
 }
 
+static void physmap_set_vpp(struct map_info *map, int state)
+{
+	struct platform_device *pdev;
+	struct physmap_flash_data *physmap_data;
+
+	pdev = (struct platform_device *)map->map_priv_1;
+	physmap_data = pdev->dev.platform_data;
+
+	if (physmap_data->set_vpp)
+		physmap_data->set_vpp(pdev, state);
+}
+
 static const char *rom_probe_types[] = {
 					"cfi_probe",
 					"jedec_probe",
@@ -81,10 +93,7 @@ static const char *rom_probe_types[] = {
 					"map_rom",
 					NULL };
 #ifdef CONFIG_MTD_PARTITIONS
-static const char *part_probe_types[] = { "cmdlinepart", "RedBoot",
-#ifdef CONFIG_MTD_AFS_PARTS
-					  "afs",
-#endif
+static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", "afs",
 					  NULL };
 #endif
 
@@ -134,8 +143,9 @@ static int physmap_flash_probe(struct platform_device *dev)
 		info->map[i].phys = dev->resource[i].start;
 		info->map[i].size = resource_size(&dev->resource[i]);
 		info->map[i].bankwidth = physmap_data->width;
-		info->map[i].set_vpp = physmap_data->set_vpp;
+		info->map[i].set_vpp = physmap_set_vpp;
 		info->map[i].pfow_base = physmap_data->pfow_base;
+		info->map[i].map_priv_1 = (unsigned long)dev;
 
 		info->map[i].virt = devm_ioremap(&dev->dev, info->map[i].phys,
 						 info->map[i].size);
diff --git a/drivers/mtd/maps/pismo.c b/drivers/mtd/maps/pismo.c
index f4ce273..65bd1cd 100644
--- a/drivers/mtd/maps/pismo.c
+++ b/drivers/mtd/maps/pismo.c
@@ -50,39 +50,13 @@ struct pismo_data {
 	struct platform_device	*dev[PISMO_NUM_CS];
 };
 
-/* FIXME: set_vpp could do with a better calling convention */
-static struct pismo_data *vpp_pismo;
-static DEFINE_MUTEX(pismo_mutex);
-
-static int pismo_setvpp_probe_fix(struct pismo_data *pismo)
+static void pismo_set_vpp(struct platform_device *pdev, int on)
 {
-	mutex_lock(&pismo_mutex);
-	if (vpp_pismo) {
-		mutex_unlock(&pismo_mutex);
-		kfree(pismo);
-		return -EBUSY;
-	}
-	vpp_pismo = pismo;
-	mutex_unlock(&pismo_mutex);
-	return 0;
-}
-
-static void pismo_setvpp_remove_fix(struct pismo_data *pismo)
-{
-	mutex_lock(&pismo_mutex);
-	if (vpp_pismo == pismo)
-		vpp_pismo = NULL;
-	mutex_unlock(&pismo_mutex);
-}
-
-static void pismo_set_vpp(struct map_info *map, int on)
-{
-	struct pismo_data *pismo = vpp_pismo;
+	struct i2c_client *client = to_i2c_client(pdev->dev.parent);
+	struct pismo_data *pismo = i2c_get_clientdata(client);
 
 	pismo->vpp(pismo->vpp_data, on);
 }
-/* end of hack */
-
 
 static unsigned int __devinit pismo_width_to_bytes(unsigned int width)
 {
@@ -231,9 +205,6 @@ static int __devexit pismo_remove(struct i2c_client *client)
 	for (i = 0; i < ARRAY_SIZE(pismo->dev); i++)
 		platform_device_unregister(pismo->dev[i]);
 
-	/* FIXME: set_vpp needs saner arguments */
-	pismo_setvpp_remove_fix(pismo);
-
 	kfree(pismo);
 
 	return 0;
@@ -257,11 +228,6 @@ static int __devinit pismo_probe(struct i2c_client *client,
 	if (!pismo)
 		return -ENOMEM;
 
-	/* FIXME: set_vpp needs saner arguments */
-	ret = pismo_setvpp_probe_fix(pismo);
-	if (ret)
-		return ret;
-
 	pismo->client = client;
 	if (pdata) {
 		pismo->vpp = pdata->set_vpp;
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index d37cca0..49b9590 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -24,7 +24,7 @@ struct physmap_flash_data {
 	unsigned int		width;
 	int			(*init)(struct platform_device *);
 	void			(*exit)(struct platform_device *);
-	void			(*set_vpp)(struct map_info *, int);
+	void			(*set_vpp)(struct platform_device *, int);
 	unsigned int		nr_parts;
 	unsigned int		pfow_base;
 	char                    *probe_type;
-- 
1.7.0.4

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

* Re: [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
  2011-05-17 13:11   ` Marc Zyngier
@ 2011-05-19 11:14     ` Artem Bityutskiy
  -1 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-05-19 11:14 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: David Woodhouse, linux-mtd, linux-arm-kernel

On Tue, 2011-05-17 at 14:11 +0100, Marc Zyngier wrote:
> In the process of moving platforms away from integrator-flash
> (aka armflash), add to physmap the few features that make
> armflash unique:
> 
> - optionnal probing for the AFS partition type
> - init() and exit() methods, used by Integrator to control
>   write access to the various onboard programmable components
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> Cc: David Woodhouse <dwmw2@infradead.org>

Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

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

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

* [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
@ 2011-05-19 11:14     ` Artem Bityutskiy
  0 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-05-19 11:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2011-05-17 at 14:11 +0100, Marc Zyngier wrote:
> In the process of moving platforms away from integrator-flash
> (aka armflash), add to physmap the few features that make
> armflash unique:
> 
> - optionnal probing for the AFS partition type
> - init() and exit() methods, used by Integrator to control
>   write access to the various onboard programmable components
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> Cc: David Woodhouse <dwmw2@infradead.org>

Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

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

* Re: [PATCH v6 7/8] MTD: Remove integrator-flash
  2011-05-17 13:11   ` Marc Zyngier
@ 2011-05-19 11:14     ` Artem Bityutskiy
  -1 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-05-19 11:14 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: David Woodhouse, linux-mtd, linux-arm-kernel

On Tue, 2011-05-17 at 14:11 +0100, Marc Zyngier wrote:
> As there is now no in-tree user of integrator-flash, remove
> it completely.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> Cc: David Woodhouse <dwmw2@infradead.org>

Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

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

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

* [PATCH v6 7/8] MTD: Remove integrator-flash
@ 2011-05-19 11:14     ` Artem Bityutskiy
  0 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-05-19 11:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2011-05-17 at 14:11 +0100, Marc Zyngier wrote:
> As there is now no in-tree user of integrator-flash, remove
> it completely.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> Cc: David Woodhouse <dwmw2@infradead.org>

Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

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

* Re: [PATCH v6 8/8] MTD: physmap: let set_vpp() pass a platform_device instead of a map_info
  2011-05-17 13:11   ` Marc Zyngier
@ 2011-05-19 11:17     ` Artem Bityutskiy
  -1 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-05-19 11:17 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Eric Miao, Philipp Zabel, Jean-Christophe Plagniol-Villard,
	Nicolas Ferre, linux-mtd, Ben Dooks, Russell King,
	David Woodhouse, Andrew Victor, linux-arm-kernel

On Tue, 2011-05-17 at 14:11 +0100, Marc Zyngier wrote:
> The set_vpp() method provided by physmap passes a map_info back to
> the platform code, which has little relevance as far as the platform
> is concerned (this parameter is completely unused).
> 
> Instead, pass the platform_device, which can be used in the pismo
> driver to retrieve some important information in a nicer way, instead
> of the hack that was in place.
> 
> The empty set_vpp function in board-at572d940hf_ek.c is left untouched,
> as the board/SoC is scheduled for removal.
> 
> Cc: Andrew Victor <linux@maxim.org.za>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Philipp Zabel <philipp.zabel@gmail.com>
> Cc: Eric Miao <eric.y.miao@gmail.com>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

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

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

* [PATCH v6 8/8] MTD: physmap: let set_vpp() pass a platform_device instead of a map_info
@ 2011-05-19 11:17     ` Artem Bityutskiy
  0 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-05-19 11:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2011-05-17 at 14:11 +0100, Marc Zyngier wrote:
> The set_vpp() method provided by physmap passes a map_info back to
> the platform code, which has little relevance as far as the platform
> is concerned (this parameter is completely unused).
> 
> Instead, pass the platform_device, which can be used in the pismo
> driver to retrieve some important information in a nicer way, instead
> of the hack that was in place.
> 
> The empty set_vpp function in board-at572d940hf_ek.c is left untouched,
> as the board/SoC is scheduled for removal.
> 
> Cc: Andrew Victor <linux@maxim.org.za>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Philipp Zabel <philipp.zabel@gmail.com>
> Cc: Eric Miao <eric.y.miao@gmail.com>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

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

* Re: [PATCH v6 0/8] Switch ARM platforms from integrator-flash to physmap
  2011-05-17 13:11 ` Marc Zyngier
@ 2011-05-19 11:19   ` Artem Bityutskiy
  -1 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-05-19 11:19 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: David Woodhouse, linux-mtd, linux-arm-kernel

On Tue, 2011-05-17 at 14:11 +0100, Marc Zyngier wrote:
> As the integrator-flash driver is mostly a duplicate of physmap,
> move all users of this driver to physmap and get rid of the
> then unused driver.
> 
> Also change the set_vpp() method in physmap to pass the
> platform_device instead of the map_info. This allows for a substantial
> cleanup in drivers/mtd/maps/pismo.c
> 
> This patch set has been ok'ed by RMK, who is willing to take it
> through his tree. This requires an ACK from the MTD maintainers. David
> Woodhouse cc-ed on the whole patch set in case he'd prefer to merge it
> via the MTD tree.

I assume the whole series will go in via some subsystem arm tree?

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

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

* [PATCH v6 0/8] Switch ARM platforms from integrator-flash to physmap
@ 2011-05-19 11:19   ` Artem Bityutskiy
  0 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-05-19 11:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2011-05-17 at 14:11 +0100, Marc Zyngier wrote:
> As the integrator-flash driver is mostly a duplicate of physmap,
> move all users of this driver to physmap and get rid of the
> then unused driver.
> 
> Also change the set_vpp() method in physmap to pass the
> platform_device instead of the map_info. This allows for a substantial
> cleanup in drivers/mtd/maps/pismo.c
> 
> This patch set has been ok'ed by RMK, who is willing to take it
> through his tree. This requires an ACK from the MTD maintainers. David
> Woodhouse cc-ed on the whole patch set in case he'd prefer to merge it
> via the MTD tree.

I assume the whole series will go in via some subsystem arm tree?

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

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

* Re: [PATCH v6 0/8] Switch ARM platforms from integrator-flash to physmap
  2011-05-19 11:19   ` Artem Bityutskiy
@ 2011-05-19 12:53     ` Marc Zyngier
  -1 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-19 12:53 UTC (permalink / raw)
  To: dedekind1; +Cc: David Woodhouse, linux-mtd, linux-arm-kernel

On Thu, 2011-05-19 at 14:19 +0300, Artem Bityutskiy wrote:
> On Tue, 2011-05-17 at 14:11 +0100, Marc Zyngier wrote:
> > As the integrator-flash driver is mostly a duplicate of physmap,
> > move all users of this driver to physmap and get rid of the
> > then unused driver.
> > 
> > Also change the set_vpp() method in physmap to pass the
> > platform_device instead of the map_info. This allows for a substantial
> > cleanup in drivers/mtd/maps/pismo.c
> > 
> > This patch set has been ok'ed by RMK, who is willing to take it
> > through his tree. This requires an ACK from the MTD maintainers. David
> > Woodhouse cc-ed on the whole patch set in case he'd prefer to merge it
> > via the MTD tree.
> 
> I assume the whole series will go in via some subsystem arm tree?
> 

Yes, it's been merged by Russell into his tree yesterday, after David's
ack.

	M.
-- 
Reality is an implementation detail.

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

* [PATCH v6 0/8] Switch ARM platforms from integrator-flash to physmap
@ 2011-05-19 12:53     ` Marc Zyngier
  0 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-19 12:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2011-05-19 at 14:19 +0300, Artem Bityutskiy wrote:
> On Tue, 2011-05-17 at 14:11 +0100, Marc Zyngier wrote:
> > As the integrator-flash driver is mostly a duplicate of physmap,
> > move all users of this driver to physmap and get rid of the
> > then unused driver.
> > 
> > Also change the set_vpp() method in physmap to pass the
> > platform_device instead of the map_info. This allows for a substantial
> > cleanup in drivers/mtd/maps/pismo.c
> > 
> > This patch set has been ok'ed by RMK, who is willing to take it
> > through his tree. This requires an ACK from the MTD maintainers. David
> > Woodhouse cc-ed on the whole patch set in case he'd prefer to merge it
> > via the MTD tree.
> 
> I assume the whole series will go in via some subsystem arm tree?
> 

Yes, it's been merged by Russell into his tree yesterday, after David's
ack.

	M.
-- 
Reality is an implementation detail.

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

* Re: [PATCH v6 8/8] MTD: physmap: let set_vpp() pass a platform_device instead of a map_info
  2011-05-19 11:17     ` Artem Bityutskiy
@ 2011-05-19 17:37       ` Jean-Christophe PLAGNIOL-VILLARD
  -1 siblings, 0 replies; 50+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-19 17:37 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: Eric Miao, Philipp Zabel, Marc Zyngier, Nicolas Ferre, linux-mtd,
	Ben Dooks, Russell King, David Woodhouse, Andrew Victor,
	linux-arm-kernel

On 14:17 Thu 19 May     , Artem Bityutskiy wrote:
> On Tue, 2011-05-17 at 14:11 +0100, Marc Zyngier wrote:
> > The set_vpp() method provided by physmap passes a map_info back to
> > the platform code, which has little relevance as far as the platform
> > is concerned (this parameter is completely unused).
> > 
> > Instead, pass the platform_device, which can be used in the pismo
> > driver to retrieve some important information in a nicer way, instead
> > of the hack that was in place.
> > 
> > The empty set_vpp function in board-at572d940hf_ek.c is left untouched,
> > as the board/SoC is scheduled for removal.
> > 
> > Cc: Andrew Victor <linux@maxim.org.za>
> > Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> > Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> > Cc: Russell King <linux@arm.linux.org.uk>
> > Cc: Philipp Zabel <philipp.zabel@gmail.com>
> > Cc: Eric Miao <eric.y.miao@gmail.com>
> > Cc: Ben Dooks <ben-linux@fluff.org>
> > Cc: David Woodhouse <dwmw2@infradead.org>
> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> 
> Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Best Regards,
J.

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

* [PATCH v6 8/8] MTD: physmap: let set_vpp() pass a platform_device instead of a map_info
@ 2011-05-19 17:37       ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 50+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-05-19 17:37 UTC (permalink / raw)
  To: linux-arm-kernel

On 14:17 Thu 19 May     , Artem Bityutskiy wrote:
> On Tue, 2011-05-17 at 14:11 +0100, Marc Zyngier wrote:
> > The set_vpp() method provided by physmap passes a map_info back to
> > the platform code, which has little relevance as far as the platform
> > is concerned (this parameter is completely unused).
> > 
> > Instead, pass the platform_device, which can be used in the pismo
> > driver to retrieve some important information in a nicer way, instead
> > of the hack that was in place.
> > 
> > The empty set_vpp function in board-at572d940hf_ek.c is left untouched,
> > as the board/SoC is scheduled for removal.
> > 
> > Cc: Andrew Victor <linux@maxim.org.za>
> > Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> > Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> > Cc: Russell King <linux@arm.linux.org.uk>
> > Cc: Philipp Zabel <philipp.zabel@gmail.com>
> > Cc: Eric Miao <eric.y.miao@gmail.com>
> > Cc: Ben Dooks <ben-linux@fluff.org>
> > Cc: David Woodhouse <dwmw2@infradead.org>
> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> 
> Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Best Regards,
J.

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

* Re: [PATCH v6 0/8] Switch ARM platforms from integrator-flash to physmap
  2011-05-19 12:53     ` Marc Zyngier
@ 2011-05-20 21:28       ` Russell King - ARM Linux
  -1 siblings, 0 replies; 50+ messages in thread
From: Russell King - ARM Linux @ 2011-05-20 21:28 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: linux-mtd, David Woodhouse, linux-arm-kernel, dedekind1

On Thu, May 19, 2011 at 01:53:34PM +0100, Marc Zyngier wrote:
> Yes, it's been merged by Russell into his tree yesterday, after David's
> ack.

... and I've just added the new acks we've had today.

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

* [PATCH v6 0/8] Switch ARM platforms from integrator-flash to physmap
@ 2011-05-20 21:28       ` Russell King - ARM Linux
  0 siblings, 0 replies; 50+ messages in thread
From: Russell King - ARM Linux @ 2011-05-20 21:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 19, 2011 at 01:53:34PM +0100, Marc Zyngier wrote:
> Yes, it's been merged by Russell into his tree yesterday, after David's
> ack.

... and I've just added the new acks we've had today.

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

* Re: [PATCH v6 0/8] Switch ARM platforms from integrator-flash to physmap
  2011-05-20 21:28       ` Russell King - ARM Linux
@ 2011-05-23 15:01         ` Artem Bityutskiy
  -1 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-05-23 15:01 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Marc Zyngier, linux-mtd, David Woodhouse, linux-arm-kernel

On Fri, 2011-05-20 at 22:28 +0100, Russell King - ARM Linux wrote:
> On Thu, May 19, 2011 at 01:53:34PM +0100, Marc Zyngier wrote:
> > Yes, it's been merged by Russell into his tree yesterday, after David's
> > ack.
> 
> ... and I've just added the new acks we've had today.

Thank you!

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

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

* [PATCH v6 0/8] Switch ARM platforms from integrator-flash to physmap
@ 2011-05-23 15:01         ` Artem Bityutskiy
  0 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-05-23 15:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2011-05-20 at 22:28 +0100, Russell King - ARM Linux wrote:
> On Thu, May 19, 2011 at 01:53:34PM +0100, Marc Zyngier wrote:
> > Yes, it's been merged by Russell into his tree yesterday, after David's
> > ack.
> 
> ... and I've just added the new acks we've had today.

Thank you!

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

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

* Re: [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
  2011-05-17 13:11   ` Marc Zyngier
@ 2011-05-31 19:11     ` Sergei Shtylyov
  -1 siblings, 0 replies; 50+ messages in thread
From: Sergei Shtylyov @ 2011-05-31 19:11 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: David Woodhouse, linux-mtd, linux-arm-kernel

Hello.

Marc Zyngier wrote:

> In the process of moving platforms away from integrator-flash
> (aka armflash), add to physmap the few features that make
> armflash unique:

> - optionnal probing for the AFS partition type
> - init() and exit() methods, used by Integrator to control
>   write access to the various onboard programmable components

> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> Cc: David Woodhouse <dwmw2@infradead.org>
[...]

> diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
> index bcfd9f7..d37cca0 100644
> --- a/include/linux/mtd/physmap.h
> +++ b/include/linux/mtd/physmap.h
> @@ -22,6 +22,8 @@ struct map_info;
>  
>  struct physmap_flash_data {
>  	unsigned int		width;
> +	int			(*init)(struct platform_device *);
> +	void			(*exit)(struct platform_device *);

    How about a declaration for 'struct platform_device' beforehand? This breaks 
build on other platforms at least...

WBR, Sergei

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

* [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
@ 2011-05-31 19:11     ` Sergei Shtylyov
  0 siblings, 0 replies; 50+ messages in thread
From: Sergei Shtylyov @ 2011-05-31 19:11 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

Marc Zyngier wrote:

> In the process of moving platforms away from integrator-flash
> (aka armflash), add to physmap the few features that make
> armflash unique:

> - optionnal probing for the AFS partition type
> - init() and exit() methods, used by Integrator to control
>   write access to the various onboard programmable components

> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> Cc: David Woodhouse <dwmw2@infradead.org>
[...]

> diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
> index bcfd9f7..d37cca0 100644
> --- a/include/linux/mtd/physmap.h
> +++ b/include/linux/mtd/physmap.h
> @@ -22,6 +22,8 @@ struct map_info;
>  
>  struct physmap_flash_data {
>  	unsigned int		width;
> +	int			(*init)(struct platform_device *);
> +	void			(*exit)(struct platform_device *);

    How about a declaration for 'struct platform_device' beforehand? This breaks 
build on other platforms at least...

WBR, Sergei

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

* Re: [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
  2011-05-31 19:11     ` Sergei Shtylyov
@ 2011-05-31 21:44       ` Marc Zyngier
  -1 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-31 21:44 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-mtd, David Woodhouse, linux-arm-kernel

On Tue, 31 May 2011 23:11:14 +0400
Sergei Shtylyov <sshtylyov@mvista.com> wrote:

> Hello.
> 
> Marc Zyngier wrote:
> 
> > In the process of moving platforms away from integrator-flash
> > (aka armflash), add to physmap the few features that make
> > armflash unique:
> 
> > - optionnal probing for the AFS partition type
> > - init() and exit() methods, used by Integrator to control
> >   write access to the various onboard programmable components
> 
> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: David Woodhouse <dwmw2@infradead.org>
> [...]
> 
> > diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
> > index bcfd9f7..d37cca0 100644
> > --- a/include/linux/mtd/physmap.h
> > +++ b/include/linux/mtd/physmap.h
> > @@ -22,6 +22,8 @@ struct map_info;
> >  
> >  struct physmap_flash_data {
> >  	unsigned int		width;
> > +	int			(*init)(struct platform_device *);
> > +	void			(*exit)(struct platform_device *);
> 
>     How about a declaration for 'struct platform_device' beforehand? This breaks 
> build on other platforms at least...

Sure. Please send a patch.

	M.
-- 
I'm the slime oozin' out from your TV set...

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

* [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
@ 2011-05-31 21:44       ` Marc Zyngier
  0 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-05-31 21:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 31 May 2011 23:11:14 +0400
Sergei Shtylyov <sshtylyov@mvista.com> wrote:

> Hello.
> 
> Marc Zyngier wrote:
> 
> > In the process of moving platforms away from integrator-flash
> > (aka armflash), add to physmap the few features that make
> > armflash unique:
> 
> > - optionnal probing for the AFS partition type
> > - init() and exit() methods, used by Integrator to control
> >   write access to the various onboard programmable components
> 
> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: David Woodhouse <dwmw2@infradead.org>
> [...]
> 
> > diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
> > index bcfd9f7..d37cca0 100644
> > --- a/include/linux/mtd/physmap.h
> > +++ b/include/linux/mtd/physmap.h
> > @@ -22,6 +22,8 @@ struct map_info;
> >  
> >  struct physmap_flash_data {
> >  	unsigned int		width;
> > +	int			(*init)(struct platform_device *);
> > +	void			(*exit)(struct platform_device *);
> 
>     How about a declaration for 'struct platform_device' beforehand? This breaks 
> build on other platforms at least...

Sure. Please send a patch.

	M.
-- 
I'm the slime oozin' out from your TV set...

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

* Re: [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
  2011-05-31 21:44       ` Marc Zyngier
@ 2011-06-01  2:20         ` Mike Frysinger
  -1 siblings, 0 replies; 50+ messages in thread
From: Mike Frysinger @ 2011-06-01  2:20 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: David Woodhouse, linux-mtd, linux-arm-kernel, Sergei Shtylyov

On Tue, May 31, 2011 at 17:44, Marc Zyngier wrote:
> On Tue, 31 May 2011 23:11:14 +0400 Sergei Shtylyov wrote:
>> Marc Zyngier wrote:
>> > In the process of moving platforms away from integrator-flash
>> > (aka armflash), add to physmap the few features that make
>> > armflash unique:
>>
>> > - optionnal probing for the AFS partition type
>> > - init() and exit() methods, used by Integrator to control
>> >   write access to the various onboard programmable components
>>
>> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
>> > Cc: David Woodhouse <dwmw2@infradead.org>
>> [...]
>>
>> > diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
>> > index bcfd9f7..d37cca0 100644
>> > --- a/include/linux/mtd/physmap.h
>> > +++ b/include/linux/mtd/physmap.h
>> > @@ -22,6 +22,8 @@ struct map_info;
>> >
>> >  struct physmap_flash_data {
>> >     unsigned int            width;
>> > +   int                     (*init)(struct platform_device *);
>> > +   void                    (*exit)(struct platform_device *);
>>
>>     How about a declaration for 'struct platform_device' beforehand? This breaks
>> build on other platforms at least...
>
> Sure. Please send a patch.

uhh, what ?  you broke things, so you fix them.  i already pointed out
this breakage to you over a week ago.
-mike

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

* [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
@ 2011-06-01  2:20         ` Mike Frysinger
  0 siblings, 0 replies; 50+ messages in thread
From: Mike Frysinger @ 2011-06-01  2:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, May 31, 2011 at 17:44, Marc Zyngier wrote:
> On Tue, 31 May 2011 23:11:14 +0400 Sergei Shtylyov wrote:
>> Marc Zyngier wrote:
>> > In the process of moving platforms away from integrator-flash
>> > (aka armflash), add to physmap the few features that make
>> > armflash unique:
>>
>> > - optionnal probing for the AFS partition type
>> > - init() and exit() methods, used by Integrator to control
>> > ? write access to the various onboard programmable components
>>
>> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
>> > Cc: David Woodhouse <dwmw2@infradead.org>
>> [...]
>>
>> > diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
>> > index bcfd9f7..d37cca0 100644
>> > --- a/include/linux/mtd/physmap.h
>> > +++ b/include/linux/mtd/physmap.h
>> > @@ -22,6 +22,8 @@ struct map_info;
>> >
>> > ?struct physmap_flash_data {
>> > ? ? unsigned int ? ? ? ? ? ?width;
>> > + ? int ? ? ? ? ? ? ? ? ? ? (*init)(struct platform_device *);
>> > + ? void ? ? ? ? ? ? ? ? ? ?(*exit)(struct platform_device *);
>>
>> ? ? How about a declaration for 'struct platform_device' beforehand? This breaks
>> build on other platforms at least...
>
> Sure. Please send a patch.

uhh, what ?  you broke things, so you fix them.  i already pointed out
this breakage to you over a week ago.
-mike

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

* Re: [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
  2011-06-01  2:20         ` Mike Frysinger
@ 2011-06-01  7:42           ` Artem Bityutskiy
  -1 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-06-01  7:42 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: Marc Zyngier, linux-mtd, David Woodhouse, Sergei Shtylyov,
	linux-arm-kernel

On Tue, 2011-05-31 at 22:20 -0400, Mike Frysinger wrote:
> On Tue, May 31, 2011 at 17:44, Marc Zyngier wrote:
> > On Tue, 31 May 2011 23:11:14 +0400 Sergei Shtylyov wrote:
> >> Marc Zyngier wrote:
> >> > In the process of moving platforms away from integrator-flash
> >> > (aka armflash), add to physmap the few features that make
> >> > armflash unique:
> >>
> >> > - optionnal probing for the AFS partition type
> >> > - init() and exit() methods, used by Integrator to control
> >> >   write access to the various onboard programmable components
> >>
> >> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> >> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> >> > Cc: David Woodhouse <dwmw2@infradead.org>
> >> [...]
> >>
> >> > diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
> >> > index bcfd9f7..d37cca0 100644
> >> > --- a/include/linux/mtd/physmap.h
> >> > +++ b/include/linux/mtd/physmap.h
> >> > @@ -22,6 +22,8 @@ struct map_info;
> >> >
> >> >  struct physmap_flash_data {
> >> >     unsigned int            width;
> >> > +   int                     (*init)(struct platform_device *);
> >> > +   void                    (*exit)(struct platform_device *);
> >>
> >>     How about a declaration for 'struct platform_device' beforehand? This breaks
> >> build on other platforms at least...
> >
> > Sure. Please send a patch.
> 
> uhh, what ?  you broke things, so you fix them.  i already pointed out
> this breakage to you over a week ago.
> -mike

The change went in via Russell's tree, I sent him a fix. It looks like
he did not merge it. Now I'm not sure who should merge this patch. I'll
ping dwmw2.

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

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

* [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
@ 2011-06-01  7:42           ` Artem Bityutskiy
  0 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-06-01  7:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2011-05-31 at 22:20 -0400, Mike Frysinger wrote:
> On Tue, May 31, 2011 at 17:44, Marc Zyngier wrote:
> > On Tue, 31 May 2011 23:11:14 +0400 Sergei Shtylyov wrote:
> >> Marc Zyngier wrote:
> >> > In the process of moving platforms away from integrator-flash
> >> > (aka armflash), add to physmap the few features that make
> >> > armflash unique:
> >>
> >> > - optionnal probing for the AFS partition type
> >> > - init() and exit() methods, used by Integrator to control
> >> >   write access to the various onboard programmable components
> >>
> >> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> >> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> >> > Cc: David Woodhouse <dwmw2@infradead.org>
> >> [...]
> >>
> >> > diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
> >> > index bcfd9f7..d37cca0 100644
> >> > --- a/include/linux/mtd/physmap.h
> >> > +++ b/include/linux/mtd/physmap.h
> >> > @@ -22,6 +22,8 @@ struct map_info;
> >> >
> >> >  struct physmap_flash_data {
> >> >     unsigned int            width;
> >> > +   int                     (*init)(struct platform_device *);
> >> > +   void                    (*exit)(struct platform_device *);
> >>
> >>     How about a declaration for 'struct platform_device' beforehand? This breaks
> >> build on other platforms at least...
> >
> > Sure. Please send a patch.
> 
> uhh, what ?  you broke things, so you fix them.  i already pointed out
> this breakage to you over a week ago.
> -mike

The change went in via Russell's tree, I sent him a fix. It looks like
he did not merge it. Now I'm not sure who should merge this patch. I'll
ping dwmw2.

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

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

* Re: [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
  2011-06-01  2:20         ` Mike Frysinger
@ 2011-06-01  7:49           ` Marc Zyngier
  -1 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-06-01  7:49 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: David Woodhouse, linux-mtd, linux-arm-kernel, Sergei Shtylyov

On Tue, 2011-05-31 at 22:20 -0400, Mike Frysinger wrote:
> On Tue, May 31, 2011 at 17:44, Marc Zyngier wrote:
> > On Tue, 31 May 2011 23:11:14 +0400 Sergei Shtylyov wrote:
> >> Marc Zyngier wrote:
> >> > In the process of moving platforms away from integrator-flash
> >> > (aka armflash), add to physmap the few features that make
> >> > armflash unique:
> >>
> >> > - optionnal probing for the AFS partition type
> >> > - init() and exit() methods, used by Integrator to control
> >> >   write access to the various onboard programmable components
> >>
> >> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> >> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> >> > Cc: David Woodhouse <dwmw2@infradead.org>
> >> [...]
> >>
> >> > diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
> >> > index bcfd9f7..d37cca0 100644
> >> > --- a/include/linux/mtd/physmap.h
> >> > +++ b/include/linux/mtd/physmap.h
> >> > @@ -22,6 +22,8 @@ struct map_info;
> >> >
> >> >  struct physmap_flash_data {
> >> >     unsigned int            width;
> >> > +   int                     (*init)(struct platform_device *);
> >> > +   void                    (*exit)(struct platform_device *);
> >>
> >>     How about a declaration for 'struct platform_device' beforehand? This breaks
> >> build on other platforms at least...
> >
> > Sure. Please send a patch.
> 
> uhh, what ?  you broke things, so you fix them.  i already pointed out
> this breakage to you over a week ago.

Mike,

Sorry I missed your earlier comment about this. My bad.

Now, about my reply to Sergei:
      * Sergei identified the problem, and proposed a valid fix. It's
        only fair he gets credited for his work (yes, you did it before
        he did, but I didn't know it). The SOB on a patch is the proper
        way of managing the attribution.
      * Posting a patch is the quickest way for the maintainer (in this
        case David) to be able to push a fix to mainline.
      * It also helps other folks reading the ML and facing the same
        issue. They can grab the patch, apply it locally and go on with
        their own stuff until the patch is merged.
      * The person reporting the problem probably has a configuration
        showing the problem. If any of my platforms had shown that
        error, I would have fixed it long before it hit the mailing
        list.

Now, to keep everyone happy, an untested patch. David, can you please
apply it?

Cheers,

	M.

>From 1440a857e119b90df68e87cf9da87fce870c86cf Mon Sep 17 00:00:00 2001
From: Marc Zyngier <marc.zyngier@arm.com>
Date: Wed, 1 Jun 2011 08:37:28 +0100
Subject: [PATCH] MTD: Fix physmap compilation error

Commit b7281ca2a4 (MTD: Add integrator-flash feature to physmap)
broke some platforms by using 'struct platform_device' without
declaring it.

Add a forward declaration to keep everyone happy.

Fix proposed by both Mike Frysinger and Sergei Shtylyov.

Reported-by: Mike Frysinger <vapier.adi@gmail.com>
Reported-by: Sergei Shtylyov <sshtylyov@mvista.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 include/linux/mtd/physmap.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index d40bfa1..e5f21d2 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -19,6 +19,7 @@
 #include <linux/mtd/partitions.h>
 
 struct map_info;
+struct platform_device;
 
 struct physmap_flash_data {
 	unsigned int		width;
-- 
1.7.0.4


-- 
Reality is an implementation detail.

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

* [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
@ 2011-06-01  7:49           ` Marc Zyngier
  0 siblings, 0 replies; 50+ messages in thread
From: Marc Zyngier @ 2011-06-01  7:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2011-05-31 at 22:20 -0400, Mike Frysinger wrote:
> On Tue, May 31, 2011 at 17:44, Marc Zyngier wrote:
> > On Tue, 31 May 2011 23:11:14 +0400 Sergei Shtylyov wrote:
> >> Marc Zyngier wrote:
> >> > In the process of moving platforms away from integrator-flash
> >> > (aka armflash), add to physmap the few features that make
> >> > armflash unique:
> >>
> >> > - optionnal probing for the AFS partition type
> >> > - init() and exit() methods, used by Integrator to control
> >> >   write access to the various onboard programmable components
> >>
> >> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> >> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> >> > Cc: David Woodhouse <dwmw2@infradead.org>
> >> [...]
> >>
> >> > diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
> >> > index bcfd9f7..d37cca0 100644
> >> > --- a/include/linux/mtd/physmap.h
> >> > +++ b/include/linux/mtd/physmap.h
> >> > @@ -22,6 +22,8 @@ struct map_info;
> >> >
> >> >  struct physmap_flash_data {
> >> >     unsigned int            width;
> >> > +   int                     (*init)(struct platform_device *);
> >> > +   void                    (*exit)(struct platform_device *);
> >>
> >>     How about a declaration for 'struct platform_device' beforehand? This breaks
> >> build on other platforms at least...
> >
> > Sure. Please send a patch.
> 
> uhh, what ?  you broke things, so you fix them.  i already pointed out
> this breakage to you over a week ago.

Mike,

Sorry I missed your earlier comment about this. My bad.

Now, about my reply to Sergei:
      * Sergei identified the problem, and proposed a valid fix. It's
        only fair he gets credited for his work (yes, you did it before
        he did, but I didn't know it). The SOB on a patch is the proper
        way of managing the attribution.
      * Posting a patch is the quickest way for the maintainer (in this
        case David) to be able to push a fix to mainline.
      * It also helps other folks reading the ML and facing the same
        issue. They can grab the patch, apply it locally and go on with
        their own stuff until the patch is merged.
      * The person reporting the problem probably has a configuration
        showing the problem. If any of my platforms had shown that
        error, I would have fixed it long before it hit the mailing
        list.

Now, to keep everyone happy, an untested patch. David, can you please
apply it?

Cheers,

	M.

>From 1440a857e119b90df68e87cf9da87fce870c86cf Mon Sep 17 00:00:00 2001
From: Marc Zyngier <marc.zyngier@arm.com>
Date: Wed, 1 Jun 2011 08:37:28 +0100
Subject: [PATCH] MTD: Fix physmap compilation error

Commit b7281ca2a4 (MTD: Add integrator-flash feature to physmap)
broke some platforms by using 'struct platform_device' without
declaring it.

Add a forward declaration to keep everyone happy.

Fix proposed by both Mike Frysinger and Sergei Shtylyov.

Reported-by: Mike Frysinger <vapier.adi@gmail.com>
Reported-by: Sergei Shtylyov <sshtylyov@mvista.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 include/linux/mtd/physmap.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index d40bfa1..e5f21d2 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -19,6 +19,7 @@
 #include <linux/mtd/partitions.h>
 
 struct map_info;
+struct platform_device;
 
 struct physmap_flash_data {
 	unsigned int		width;
-- 
1.7.0.4


-- 
Reality is an implementation detail.

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

* Re: [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
  2011-06-01  7:49           ` Marc Zyngier
@ 2011-06-01  9:43             ` Artem Bityutskiy
  -1 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-06-01  9:43 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: linux-mtd, Sergei Shtylyov, David Woodhouse, linux-arm-kernel,
	Mike Frysinger

On Wed, 2011-06-01 at 08:49 +0100, Marc Zyngier wrote:
> On Tue, 2011-05-31 at 22:20 -0400, Mike Frysinger wrote:
> > On Tue, May 31, 2011 at 17:44, Marc Zyngier wrote:
> > > On Tue, 31 May 2011 23:11:14 +0400 Sergei Shtylyov wrote:
> > >> Marc Zyngier wrote:
> > >> > In the process of moving platforms away from integrator-flash
> > >> > (aka armflash), add to physmap the few features that make
> > >> > armflash unique:
> > >>
> > >> > - optionnal probing for the AFS partition type
> > >> > - init() and exit() methods, used by Integrator to control
> > >> >   write access to the various onboard programmable components
> > >>
> > >> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> > >> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> > >> > Cc: David Woodhouse <dwmw2@infradead.org>
> > >> [...]
> > >>
> > >> > diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
> > >> > index bcfd9f7..d37cca0 100644
> > >> > --- a/include/linux/mtd/physmap.h
> > >> > +++ b/include/linux/mtd/physmap.h
> > >> > @@ -22,6 +22,8 @@ struct map_info;
> > >> >
> > >> >  struct physmap_flash_data {
> > >> >     unsigned int            width;
> > >> > +   int                     (*init)(struct platform_device *);
> > >> > +   void                    (*exit)(struct platform_device *);
> > >>
> > >>     How about a declaration for 'struct platform_device' beforehand? This breaks
> > >> build on other platforms at least...
> > >
> > > Sure. Please send a patch.
> > 
> > uhh, what ?  you broke things, so you fix them.  i already pointed out
> > this breakage to you over a week ago.
> 
> Mike,
> 
> Sorry I missed your earlier comment about this. My bad.
> 
> Now, about my reply to Sergei:
>       * Sergei identified the problem, and proposed a valid fix. It's
>         only fair he gets credited for his work (yes, you did it before
>         he did, but I didn't know it). The SOB on a patch is the proper
>         way of managing the attribution.
>       * Posting a patch is the quickest way for the maintainer (in this
>         case David) to be able to push a fix to mainline.
>       * It also helps other folks reading the ML and facing the same
>         issue. They can grab the patch, apply it locally and go on with
>         their own stuff until the patch is merged.
>       * The person reporting the problem probably has a configuration
>         showing the problem. If any of my platforms had shown that
>         error, I would have fixed it long before it hit the mailing
>         list.
> 
> Now, to keep everyone happy, an untested patch. David, can you please
> apply it?
> 
> Cheers,
> 
> 	M.
> 
> >From 1440a857e119b90df68e87cf9da87fce870c86cf Mon Sep 17 00:00:00 2001
> From: Marc Zyngier <marc.zyngier@arm.com>
> Date: Wed, 1 Jun 2011 08:37:28 +0100
> Subject: [PATCH] MTD: Fix physmap compilation error
> 
> Commit b7281ca2a4 (MTD: Add integrator-flash feature to physmap)
> broke some platforms by using 'struct platform_device' without
> declaring it.
> 
> Add a forward declaration to keep everyone happy.
> 
> Fix proposed by both Mike Frysinger and Sergei Shtylyov.

The first person who sent a patch was Randy, so we already have the
patch, now it is only about merging it.

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

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

* [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
@ 2011-06-01  9:43             ` Artem Bityutskiy
  0 siblings, 0 replies; 50+ messages in thread
From: Artem Bityutskiy @ 2011-06-01  9:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2011-06-01 at 08:49 +0100, Marc Zyngier wrote:
> On Tue, 2011-05-31 at 22:20 -0400, Mike Frysinger wrote:
> > On Tue, May 31, 2011 at 17:44, Marc Zyngier wrote:
> > > On Tue, 31 May 2011 23:11:14 +0400 Sergei Shtylyov wrote:
> > >> Marc Zyngier wrote:
> > >> > In the process of moving platforms away from integrator-flash
> > >> > (aka armflash), add to physmap the few features that make
> > >> > armflash unique:
> > >>
> > >> > - optionnal probing for the AFS partition type
> > >> > - init() and exit() methods, used by Integrator to control
> > >> >   write access to the various onboard programmable components
> > >>
> > >> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> > >> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> > >> > Cc: David Woodhouse <dwmw2@infradead.org>
> > >> [...]
> > >>
> > >> > diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
> > >> > index bcfd9f7..d37cca0 100644
> > >> > --- a/include/linux/mtd/physmap.h
> > >> > +++ b/include/linux/mtd/physmap.h
> > >> > @@ -22,6 +22,8 @@ struct map_info;
> > >> >
> > >> >  struct physmap_flash_data {
> > >> >     unsigned int            width;
> > >> > +   int                     (*init)(struct platform_device *);
> > >> > +   void                    (*exit)(struct platform_device *);
> > >>
> > >>     How about a declaration for 'struct platform_device' beforehand? This breaks
> > >> build on other platforms at least...
> > >
> > > Sure. Please send a patch.
> > 
> > uhh, what ?  you broke things, so you fix them.  i already pointed out
> > this breakage to you over a week ago.
> 
> Mike,
> 
> Sorry I missed your earlier comment about this. My bad.
> 
> Now, about my reply to Sergei:
>       * Sergei identified the problem, and proposed a valid fix. It's
>         only fair he gets credited for his work (yes, you did it before
>         he did, but I didn't know it). The SOB on a patch is the proper
>         way of managing the attribution.
>       * Posting a patch is the quickest way for the maintainer (in this
>         case David) to be able to push a fix to mainline.
>       * It also helps other folks reading the ML and facing the same
>         issue. They can grab the patch, apply it locally and go on with
>         their own stuff until the patch is merged.
>       * The person reporting the problem probably has a configuration
>         showing the problem. If any of my platforms had shown that
>         error, I would have fixed it long before it hit the mailing
>         list.
> 
> Now, to keep everyone happy, an untested patch. David, can you please
> apply it?
> 
> Cheers,
> 
> 	M.
> 
> >From 1440a857e119b90df68e87cf9da87fce870c86cf Mon Sep 17 00:00:00 2001
> From: Marc Zyngier <marc.zyngier@arm.com>
> Date: Wed, 1 Jun 2011 08:37:28 +0100
> Subject: [PATCH] MTD: Fix physmap compilation error
> 
> Commit b7281ca2a4 (MTD: Add integrator-flash feature to physmap)
> broke some platforms by using 'struct platform_device' without
> declaring it.
> 
> Add a forward declaration to keep everyone happy.
> 
> Fix proposed by both Mike Frysinger and Sergei Shtylyov.

The first person who sent a patch was Randy, so we already have the
patch, now it is only about merging it.

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

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

* Re: [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
  2011-06-01  7:49           ` Marc Zyngier
@ 2011-06-01 16:28             ` Sergei Shtylyov
  -1 siblings, 0 replies; 50+ messages in thread
From: Sergei Shtylyov @ 2011-06-01 16:28 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: linux-arm-kernel, David Woodhouse, linux-mtd, Sergei Shtylyov,
	Mike Frysinger

Marc Zyngier wrote:

>>>>> In the process of moving platforms away from integrator-flash
>>>>> (aka armflash), add to physmap the few features that make
>>>>> armflash unique:
>>>>> - optionnal probing for the AFS partition type
>>>>> - init() and exit() methods, used by Integrator to control
>>>>>   write access to the various onboard programmable components
>>>>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>>>>> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
>>>>> Cc: David Woodhouse <dwmw2@infradead.org>
>>>> [...]

>>>>> diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
>>>>> index bcfd9f7..d37cca0 100644
>>>>> --- a/include/linux/mtd/physmap.h
>>>>> +++ b/include/linux/mtd/physmap.h
>>>>> @@ -22,6 +22,8 @@ struct map_info;
>>>>>
>>>>>  struct physmap_flash_data {
>>>>>     unsigned int            width;
>>>>> +   int                     (*init)(struct platform_device *);
>>>>> +   void                    (*exit)(struct platform_device *);

>>>>     How about a declaration for 'struct platform_device' beforehand? This breaks
>>>> build on other platforms at least...

>>> Sure. Please send a patch.

>> uhh, what ?  you broke things, so you fix them.  i already pointed out
>> this breakage to you over a week ago.

> Mike,

> Sorry I missed your earlier comment about this. My bad.

> Now, about my reply to Sergei:
>       * Sergei identified the problem, and proposed a valid fix. It's
>         only fair he gets credited for his work (yes, you did it before
>         he did, but I didn't know it). The SOB on a patch is the proper
>         way of managing the attribution.
>       * Posting a patch is the quickest way for the maintainer (in this
>         case David) to be able to push a fix to mainline.
>       * It also helps other folks reading the ML and facing the same
>         issue. They can grab the patch, apply it locally and go on with
>         their own stuff until the patch is merged.
>       * The person reporting the problem probably has a configuration
>         showing the problem. If any of my platforms had shown that
>         error, I would have fixed it long before it hit the mailing
>         list.

    Actually, I'm not a primary reporter. The issue came up on the #mipslinux 
IRC channel, I then just remembered that I saw the patch set touching this file, 
and it was easy enough to complain to you after finding the corresponding mails.
    This happens to break MIPS platforms because they use warnings-as-errors 
option of gcc.

WBR, Sergei

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

* [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
@ 2011-06-01 16:28             ` Sergei Shtylyov
  0 siblings, 0 replies; 50+ messages in thread
From: Sergei Shtylyov @ 2011-06-01 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Marc Zyngier wrote:

>>>>> In the process of moving platforms away from integrator-flash
>>>>> (aka armflash), add to physmap the few features that make
>>>>> armflash unique:
>>>>> - optionnal probing for the AFS partition type
>>>>> - init() and exit() methods, used by Integrator to control
>>>>>   write access to the various onboard programmable components
>>>>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>>>>> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
>>>>> Cc: David Woodhouse <dwmw2@infradead.org>
>>>> [...]

>>>>> diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
>>>>> index bcfd9f7..d37cca0 100644
>>>>> --- a/include/linux/mtd/physmap.h
>>>>> +++ b/include/linux/mtd/physmap.h
>>>>> @@ -22,6 +22,8 @@ struct map_info;
>>>>>
>>>>>  struct physmap_flash_data {
>>>>>     unsigned int            width;
>>>>> +   int                     (*init)(struct platform_device *);
>>>>> +   void                    (*exit)(struct platform_device *);

>>>>     How about a declaration for 'struct platform_device' beforehand? This breaks
>>>> build on other platforms at least...

>>> Sure. Please send a patch.

>> uhh, what ?  you broke things, so you fix them.  i already pointed out
>> this breakage to you over a week ago.

> Mike,

> Sorry I missed your earlier comment about this. My bad.

> Now, about my reply to Sergei:
>       * Sergei identified the problem, and proposed a valid fix. It's
>         only fair he gets credited for his work (yes, you did it before
>         he did, but I didn't know it). The SOB on a patch is the proper
>         way of managing the attribution.
>       * Posting a patch is the quickest way for the maintainer (in this
>         case David) to be able to push a fix to mainline.
>       * It also helps other folks reading the ML and facing the same
>         issue. They can grab the patch, apply it locally and go on with
>         their own stuff until the patch is merged.
>       * The person reporting the problem probably has a configuration
>         showing the problem. If any of my platforms had shown that
>         error, I would have fixed it long before it hit the mailing
>         list.

    Actually, I'm not a primary reporter. The issue came up on the #mipslinux 
IRC channel, I then just remembered that I saw the patch set touching this file, 
and it was easy enough to complain to you after finding the corresponding mails.
    This happens to break MIPS platforms because they use warnings-as-errors 
option of gcc.

WBR, Sergei

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

* Re: [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
  2011-06-01  7:42           ` Artem Bityutskiy
@ 2011-06-01 16:32             ` Sergei Shtylyov
  -1 siblings, 0 replies; 50+ messages in thread
From: Sergei Shtylyov @ 2011-06-01 16:32 UTC (permalink / raw)
  To: dedekind1
  Cc: Mike Frysinger, Sergei Shtylyov, Marc Zyngier, linux-mtd,
	David Woodhouse, linux-arm-kernel

Hello.

Artem Bityutskiy wrote:

>>>>> In the process of moving platforms away from integrator-flash
>>>>> (aka armflash), add to physmap the few features that make
>>>>> armflash unique:
>>>>> - optionnal probing for the AFS partition type
>>>>> - init() and exit() methods, used by Integrator to control
>>>>>   write access to the various onboard programmable components
>>>>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>>>>> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
>>>>> Cc: David Woodhouse <dwmw2@infradead.org>
>>>> [...]

>>>>> diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
>>>>> index bcfd9f7..d37cca0 100644
>>>>> --- a/include/linux/mtd/physmap.h
>>>>> +++ b/include/linux/mtd/physmap.h
>>>>> @@ -22,6 +22,8 @@ struct map_info;
>>>>>
>>>>>  struct physmap_flash_data {
>>>>>     unsigned int            width;
>>>>> +   int                     (*init)(struct platform_device *);
>>>>> +   void                    (*exit)(struct platform_device *);
>>>>     How about a declaration for 'struct platform_device' beforehand? This breaks
>>>> build on other platforms at least...

>>> Sure. Please send a patch.

>> uhh, what ?  you broke things, so you fix them.  i already pointed out
>> this breakage to you over a week ago.
>> -mike

> The change went in via Russell's tree, I sent him a fix. It looks like
> he did not merge it.

    Russell doesn't merge patches sent to him AFAIK, they need to be put into 
his patch system first.

WBR, Sergei

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

* [PATCH v6 1/8] MTD: Add integrator-flash feature to physmap
@ 2011-06-01 16:32             ` Sergei Shtylyov
  0 siblings, 0 replies; 50+ messages in thread
From: Sergei Shtylyov @ 2011-06-01 16:32 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

Artem Bityutskiy wrote:

>>>>> In the process of moving platforms away from integrator-flash
>>>>> (aka armflash), add to physmap the few features that make
>>>>> armflash unique:
>>>>> - optionnal probing for the AFS partition type
>>>>> - init() and exit() methods, used by Integrator to control
>>>>>   write access to the various onboard programmable components
>>>>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>>>>> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
>>>>> Cc: David Woodhouse <dwmw2@infradead.org>
>>>> [...]

>>>>> diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
>>>>> index bcfd9f7..d37cca0 100644
>>>>> --- a/include/linux/mtd/physmap.h
>>>>> +++ b/include/linux/mtd/physmap.h
>>>>> @@ -22,6 +22,8 @@ struct map_info;
>>>>>
>>>>>  struct physmap_flash_data {
>>>>>     unsigned int            width;
>>>>> +   int                     (*init)(struct platform_device *);
>>>>> +   void                    (*exit)(struct platform_device *);
>>>>     How about a declaration for 'struct platform_device' beforehand? This breaks
>>>> build on other platforms at least...

>>> Sure. Please send a patch.

>> uhh, what ?  you broke things, so you fix them.  i already pointed out
>> this breakage to you over a week ago.
>> -mike

> The change went in via Russell's tree, I sent him a fix. It looks like
> he did not merge it.

    Russell doesn't merge patches sent to him AFAIK, they need to be put into 
his patch system first.

WBR, Sergei

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

end of thread, other threads:[~2011-06-01 16:32 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-17 13:11 [PATCH v6 0/8] Switch ARM platforms from integrator-flash to physmap Marc Zyngier
2011-05-17 13:11 ` Marc Zyngier
2011-05-17 13:11 ` [PATCH v6 1/8] MTD: Add integrator-flash feature " Marc Zyngier
2011-05-17 13:11   ` Marc Zyngier
2011-05-19 11:14   ` Artem Bityutskiy
2011-05-19 11:14     ` Artem Bityutskiy
2011-05-31 19:11   ` Sergei Shtylyov
2011-05-31 19:11     ` Sergei Shtylyov
2011-05-31 21:44     ` Marc Zyngier
2011-05-31 21:44       ` Marc Zyngier
2011-06-01  2:20       ` Mike Frysinger
2011-06-01  2:20         ` Mike Frysinger
2011-06-01  7:42         ` Artem Bityutskiy
2011-06-01  7:42           ` Artem Bityutskiy
2011-06-01 16:32           ` Sergei Shtylyov
2011-06-01 16:32             ` Sergei Shtylyov
2011-06-01  7:49         ` Marc Zyngier
2011-06-01  7:49           ` Marc Zyngier
2011-06-01  9:43           ` Artem Bityutskiy
2011-06-01  9:43             ` Artem Bityutskiy
2011-06-01 16:28           ` Sergei Shtylyov
2011-06-01 16:28             ` Sergei Shtylyov
2011-05-17 13:11 ` [PATCH v6 2/8] ARM: Realview: Use physmap driver instead of integrator-flash Marc Zyngier
2011-05-17 13:11   ` Marc Zyngier
2011-05-17 13:11 ` [PATCH v6 3/8] ARM: Versatile: " Marc Zyngier
2011-05-17 13:11   ` Marc Zyngier
2011-05-17 13:11 ` [PATCH v6 4/8] ARM: VExpress: " Marc Zyngier
2011-05-17 13:11   ` Marc Zyngier
2011-05-17 13:11 ` [PATCH v6 5/8] ARM: Integrator/AP: " Marc Zyngier
2011-05-17 13:11   ` Marc Zyngier
2011-05-17 13:11 ` [PATCH v6 6/8] ARM: Integrator/CP: " Marc Zyngier
2011-05-17 13:11   ` Marc Zyngier
2011-05-17 13:11 ` [PATCH v6 7/8] MTD: Remove integrator-flash Marc Zyngier
2011-05-17 13:11   ` Marc Zyngier
2011-05-19 11:14   ` Artem Bityutskiy
2011-05-19 11:14     ` Artem Bityutskiy
2011-05-17 13:11 ` [PATCH v6 8/8] MTD: physmap: let set_vpp() pass a platform_device instead of a map_info Marc Zyngier
2011-05-17 13:11   ` Marc Zyngier
2011-05-19 11:17   ` Artem Bityutskiy
2011-05-19 11:17     ` Artem Bityutskiy
2011-05-19 17:37     ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-19 17:37       ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-19 11:19 ` [PATCH v6 0/8] Switch ARM platforms from integrator-flash to physmap Artem Bityutskiy
2011-05-19 11:19   ` Artem Bityutskiy
2011-05-19 12:53   ` Marc Zyngier
2011-05-19 12:53     ` Marc Zyngier
2011-05-20 21:28     ` Russell King - ARM Linux
2011-05-20 21:28       ` Russell King - ARM Linux
2011-05-23 15:01       ` Artem Bityutskiy
2011-05-23 15:01         ` Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.