From patchwork Sun Oct 15 23:20:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav Michl X-Patchwork-Id: 10007329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9C68D60230 for ; Sun, 15 Oct 2017 23:20:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6183E269E2 for ; Sun, 15 Oct 2017 23:20:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 337B426E40; Sun, 15 Oct 2017 23:20:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC548269B2 for ; Sun, 15 Oct 2017 23:20:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751394AbdJOXUN (ORCPT ); Sun, 15 Oct 2017 19:20:13 -0400 Received: from eddie.linux-mips.org ([148.251.95.138]:44780 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751235AbdJOXUM (ORCPT ); Sun, 15 Oct 2017 19:20:12 -0400 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23990398AbdJOXULixKqK (ORCPT ); Mon, 16 Oct 2017 01:20:11 +0200 Date: Mon, 16 Oct 2017 01:20:10 +0200 From: Ladislav Michl To: linux-omap@vger.kernel.org Cc: Roger Quadros , Tony Lindgren Subject: [PATCH 06/11] ARM: OMAP2+: gpmc-onenand: Add helper init function Message-ID: <20171015232010.m4dqens3hp5pwdwi@lenoch> References: <20171015231641.zt5fz6fidp5eczf6@lenoch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20171015231641.zt5fz6fidp5eczf6@lenoch> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ladislav Michl --- arch/arm/mach-omap2/gpmc-onenand.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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) {