From patchwork Fri May 17 14:55:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2583181 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 1565ADF215 for ; Fri, 17 May 2013 14:55:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755096Ab3EQOz1 (ORCPT ); Fri, 17 May 2013 10:55:27 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]:60185 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754991Ab3EQOz0 (ORCPT ); Fri, 17 May 2013 10:55:26 -0400 Received: from axis700.grange (dslb-088-076-018-110.pools.arcor-ip.net [88.76.18.110]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0Liq3V-1U5fs71Lob-00cqct; Fri, 17 May 2013 16:55:22 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 2A86740BC3; Fri, 17 May 2013 16:55:21 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1UdM40-0004H9-O1; Fri, 17 May 2013 16:55:20 +0200 From: Guennadi Liakhovetski To: linux-sh@vger.kernel.org Cc: Magnus Damm , Simon Horman , Laurent Pinchart , Linus Walleij , Guennadi Liakhovetski Subject: [PATCH 8/9] ARM: shmobile: APE6EVM: switch to using platform_add_devices() Date: Fri, 17 May 2013 16:55:19 +0200 Message-Id: <1368802520-16378-9-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1368802520-16378-1-git-send-email-g.liakhovetski@gmx.de> References: <1368802520-16378-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:F9BU26kd/Roe+j178g9ZXMem4vTaV3UqGeElwamFpJY HeENqyMauroMWua+SR2J8NMz3wEwIM4yfyNqYmLXEq7FcjgWWj hKyR+uwaAiX3QG3eAr98CsSVL+tyzdREN1rO/fK+dx1cxrqLbP 8cG0IcehNTYwg6EGM2eo8iDYhBbC6ZP79pkjoSjUAViWG8UEyz v3VgKr5o3mMsOFjm/6Lvm8qcNRSCBAvL9GIqlXRHjVsiYwhbSC 4r0HCnDwNT05K8C0tCeDYpfiCnGIb4q4blKT4PsrpX5g5tf4Id bU2D6vAEYUgfE9rcDdbXey0b8z8a0UEGx/vcgzaOg/dhDU0J+S xtuGr6FNySKdVzolU2M+IAzg2JiNHnGGp8UeGkFljC3V+KUDeX 9gFyPArNzLpMw== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Switch from platform_device_register_resndata() to platform_add_devices() to make adding new devices easier. Signed-off-by: Guennadi Liakhovetski --- arch/arm/mach-shmobile/board-ape6evm.c | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c index 5eb0caa..9c69643 100644 --- a/arch/arm/mach-shmobile/board-ape6evm.c +++ b/arch/arm/mach-shmobile/board-ape6evm.c @@ -41,7 +41,7 @@ static struct regulator_consumer_supply dummy_supplies[] = { }; /* SMSC LAN9220 */ -static const struct resource lan9220_res[] = { +static struct resource lan9220_res[] = { DEFINE_RES_MEM(0x08000000, 0x1000), { .start = irq_pin(40), /* IRQ40 */ @@ -49,12 +49,22 @@ static const struct resource lan9220_res[] = { }, }; -static const struct smsc911x_platform_config lan9220_data = { +static struct smsc911x_platform_config lan9220_data = { .flags = SMSC911X_USE_32BIT, .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, }; +static struct platform_device lan9220_device = { + .name = "smsc911x", + .id = -1, + .num_resources = ARRAY_SIZE(lan9220_res), + .resource = lan9220_res, + .dev = { + .platform_data = &lan9220_data, + }, +}; + static const struct pinctrl_map ape6evm_pinctrl_map[] = { /* SCIFA0 console */ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a73a4", @@ -64,6 +74,13 @@ static const struct pinctrl_map ape6evm_pinctrl_map[] = { "irqc_irq40", "irqc"), }; +/* + * board devices + */ +static struct platform_device *ape6evm_devices[] __initdata = { + &lan9220_device, +}; + static void __init ape6evm_add_standard_devices(void) { @@ -91,9 +108,8 @@ static void __init ape6evm_add_standard_devices(void) regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); - platform_device_register_resndata(&platform_bus, "smsc911x", -1, - lan9220_res, ARRAY_SIZE(lan9220_res), - &lan9220_data, sizeof(lan9220_data)); + platform_add_devices(ape6evm_devices, + ARRAY_SIZE(ape6evm_devices)); } static const char *ape6evm_boards_compat_dt[] __initdata = {