From patchwork Tue Sep 24 06:04:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 2931651 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9F846BFF05 for ; Tue, 24 Sep 2013 06:04:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AAC82203E5 for ; Tue, 24 Sep 2013 06:04:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 97BA7203DF for ; Tue, 24 Sep 2013 06:04:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750742Ab3IXGEX (ORCPT ); Tue, 24 Sep 2013 02:04:23 -0400 Received: from mail-pb0-f42.google.com ([209.85.160.42]:36291 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714Ab3IXGEW (ORCPT ); Tue, 24 Sep 2013 02:04:22 -0400 Received: by mail-pb0-f42.google.com with SMTP id un15so4155528pbc.15 for ; Mon, 23 Sep 2013 23:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:sender:message-id:to:cc:in-reply-to:references:from:subject :mime-version:content-type; bh=/FgOv9wbN3Y/ivaOx3Kxwh+cbdHDLV/erLc8vNeGItA=; b=FCn8/h/8RhKxHBvZVt3doJoq0gBR1z6L3P9bvpE4XeRQWNIwy9723nyF2/lZeY5JFt dovucLleCaEc1zp/3UHhu3+eBvRCW+N/U2eyx+frMu2iwYVxa5qpQxoLCM4TVUEqY9KB e30k5Bc/SLIFBCrrO3RwCFqJvw1a9MDSQnGgCEBKrWjLC2jznkmAWRwurOPByaAN6ake L8z47GneIx5LjC/7PoYC9HUDmWEUg/9faXQsC9v/2qhUyxFLtqyKGR5ruAjVC4e3mEh6 zgr/4+7oKiZt5Z992L9I9554RBdUnhi+56yReBrgHhezefH+Zqzag2ifhF7VW5WSuqO9 B3Ig== X-Received: by 10.66.156.229 with SMTP id wh5mr4863094pab.156.1380002662503; Mon, 23 Sep 2013 23:04:22 -0700 (PDT) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id om2sm38386497pbc.30.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Sep 2013 23:04:21 -0700 (PDT) Date: Mon, 23 Sep 2013 23:04:21 -0700 (PDT) Message-ID: <871u4esql9.wl%kuninori.morimoto.gx@renesas.com> To: Simon Cc: Magnus , linux-sh@vger.kernel.org, Kuninori Morimoto In-Reply-To: <874n9asqmo.wl%kuninori.morimoto.gx@renesas.com> References: <874n9asqmo.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/3] ARM: shmobile: r8a7778: cleanup registration of sh_eth MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP sh_eth driver which needs platform data at the time of registration is used from BockW only. Now, ARM/shmobile aims to support DT, and the C code base board support will be removed if DT support is completed. Current driver registration method which needs platform data and which is not shared complicates codes. This means legacy C code cleanup after DT supporting will be more complicated This patch registers it on board code as cleanup C code Signed-off-by: Kuninori Morimoto --- arch/arm/mach-shmobile/board-bockw.c | 14 +++++++++++++- arch/arm/mach-shmobile/include/mach/r8a7778.h | 1 - arch/arm/mach-shmobile/setup-r8a7778.c | 14 -------------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c index 450ac3d..3644b40 100644 --- a/arch/arm/mach-shmobile/board-bockw.c +++ b/arch/arm/mach-shmobile/board-bockw.c @@ -206,6 +206,12 @@ static struct resource sdhi0_resources[] __initdata = { DEFINE_RES_IRQ(gic_iid(0x77)), }; +/* Ether */ +static struct resource ether_resources[] __initdata = { + DEFINE_RES_MEM(0xfde00000, 0x400), + DEFINE_RES_IRQ(gic_iid(0x89)), +}; + static struct sh_eth_plat_data ether_platform_data __initdata = { .phy = 0x01, .edmac_endian = EDMAC_LITTLE_ENDIAN, @@ -568,7 +574,13 @@ static void __init bockw_init(void) r8a7778_clock_init(); r8a7778_init_irq_extpin(1); r8a7778_add_standard_devices(); - r8a7778_add_ether_device(ðer_platform_data); + + platform_device_register_resndata(&platform_bus, "r8a777x-ether", -1, + ether_resources, + ARRAY_SIZE(ether_resources), + ðer_platform_data, + sizeof(ether_platform_data)); + platform_device_register_full(&vin0_info); /* VIN1 has a pin conflict with Ether */ if (!IS_ENABLED(CONFIG_SH_ETH)) diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h index cb99721..fdbd37d 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7778.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h @@ -23,7 +23,6 @@ extern void r8a7778_add_standard_devices(void); extern void r8a7778_add_standard_devices_dt(void); -extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata); extern void r8a7778_add_dt_devices(void); extern void r8a7778_init_late(void); diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index e5d97dd..31e77a8 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c @@ -191,20 +191,6 @@ static struct platform_device_info hci##_info __initdata = { \ USB_PLATFORM_INFO(ehci); USB_PLATFORM_INFO(ohci); -/* Ether */ -static struct resource ether_resources[] __initdata = { - DEFINE_RES_MEM(0xfde00000, 0x400), - DEFINE_RES_IRQ(gic_iid(0x89)), -}; - -void __init r8a7778_add_ether_device(struct sh_eth_plat_data *pdata) -{ - platform_device_register_resndata(&platform_bus, "r8a777x-ether", -1, - ether_resources, - ARRAY_SIZE(ether_resources), - pdata, sizeof(*pdata)); -} - /* PFC/GPIO */ static struct resource pfc_resources[] __initdata = { DEFINE_RES_MEM(0xfffc0000, 0x118),