diff mbox

[06/11] ARM: OMAP2+: gpmc-onenand: Add helper init function

Message ID 20171015232010.m4dqens3hp5pwdwi@lenoch (mailing list archive)
State New, archived
Headers show

Commit Message

Ladislav Michl Oct. 15, 2017, 11:20 p.m. UTC
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 arch/arm/mach-omap2/gpmc-onenand.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index 10e80bdde5ee..2b28cc95dda4 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -306,11 +306,8 @@  static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr)
 	return ret;
 }
 
-int gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
+int gpmc_omap_onenand_init(struct omap_onenand_platform_data *_onenand_data)
 {
-	int err;
-	struct device *dev = &gpmc_onenand_device.dev;
-
 	gpmc_onenand_data = _onenand_data;
 	gpmc_onenand_data->onenand_setup = gpmc_onenand_setup;
 	gpmc_onenand_device.dev.platform_data = gpmc_onenand_data;
@@ -320,6 +317,17 @@  int gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
 	else
 		gpmc_onenand_data->flags &= ~ONENAND_IN_OMAP34XX;
 
+	return 0;
+
+}
+
+int gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
+{
+	int err;
+	struct device *dev = &gpmc_onenand_device.dev;
+
+	gpmc_omap_onenand_init(_onenand_data);
+
 	err = gpmc_cs_request(gpmc_onenand_data->cs, ONENAND_IO_SIZE,
 				(unsigned long *)&gpmc_onenand_resource.start);
 	if (err < 0) {