From patchwork Thu Nov 1 09:26:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 1683651 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id B1F733FCDF for ; Thu, 1 Nov 2012 09:33:12 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TTr7B-00067X-05; Thu, 01 Nov 2012 09:31:05 +0000 Received: from smtp1.mail.ru ([94.100.176.129]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TTr3L-0005AL-9g for linux-arm-kernel@lists.infradead.org; Thu, 01 Nov 2012 09:27:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=Message-Id:Date:Subject:Cc:To:From; bh=6uFeBPVfWwbGuvPFfJy1PNwB+RStUxyl8xNdZ+QiFuQ=; b=kVSWE1V6/k6aUntZuSzq7EcYVemzmkYcUU9RyNsccTZg33hkuVxzO5xxJ+pmnvNiaXLAV/ahWF56wC1TLyaGXcO9e3DPvUrh0r4qQbWlMBKhtWPqsN9nDlt1mNZAOeyi; Received: from [188.134.40.128] (port=33548 helo=shc.zet) by smtp1.mail.ru with esmtpa (envelope-from ) id 1TTr3H-0001ZR-Ir; Thu, 01 Nov 2012 13:27:03 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 01/15] ARM: clps711x: Load serial driver from boards Date: Thu, 1 Nov 2012 13:26:31 +0400 Message-Id: <1351762006-27368-1-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.7.8.6 X-Spam: Not detected X-Mras: Ok X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121101_052708_046317_C4D0B406 X-CRM114-Status: GOOD ( 14.09 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (shc_work[at]mail.ru) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [94.100.176.129 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Olof Johansson , Russell King , Alexander Shiyan , Arnd Bergmann X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Currently serial driver for CLPS711X is autoloaded if it compiled in kernel. Since we may have multiple platforms into single kernel we should avoid this. This patch removes this trick and adds registration of serial driver into board support code. Signed-off-by: Alexander Shiyan --- arch/arm/mach-clps711x/autcpu12.c | 6 +++--- arch/arm/mach-clps711x/cdb89712.c | 9 ++++++++- arch/arm/mach-clps711x/clep7312.c | 9 +++++++-- arch/arm/mach-clps711x/edb7211.c | 11 +++++++++-- arch/arm/mach-clps711x/fortunet.c | 9 ++++++++- arch/arm/mach-clps711x/p720t.c | 11 +++++++++-- drivers/tty/serial/clps711x.c | 16 ---------------- 7 files changed, 44 insertions(+), 27 deletions(-) diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c index 214547b..f4f122d 100644 --- a/arch/arm/mach-clps711x/autcpu12.c +++ b/arch/arm/mach-clps711x/autcpu12.c @@ -68,16 +68,16 @@ static struct platform_device autcpu12_nvram_pdev __initdata = { static void __init autcpu12_init(void) { + platform_device_register_simple("uart-clps711x", 0, NULL, 0); platform_device_register(&autcpu12_nvram_pdev); } MACHINE_START(AUTCPU12, "autronix autcpu12") /* Maintainer: Thomas Gleixner */ .atag_offset = 0x20000, - .init_machine = autcpu12_init, .map_io = autcpu12_map_io, + .init_machine = autcpu12_init, .init_irq = clps711x_init_irq, - .timer = &clps711x_timer, .restart = clps711x_restart, + .timer = &clps711x_timer, MACHINE_END - diff --git a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c index d90d25c..5a03888 100644 --- a/arch/arm/mach-clps711x/cdb89712.c +++ b/arch/arm/mach-clps711x/cdb89712.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -53,11 +54,17 @@ static void __init cdb89712_map_io(void) iotable_init(cdb89712_io_desc, ARRAY_SIZE(cdb89712_io_desc)); } +static void __init cdb89712_init(void) +{ + platform_device_register_simple("uart-clps711x", 0, NULL, 0); +} + MACHINE_START(CDB89712, "Cirrus-CDB89712") /* Maintainer: Ray Lehtiniemi */ .atag_offset = 0x100, .map_io = cdb89712_map_io, + .init_machine = cdb89712_init, .init_irq = clps711x_init_irq, - .timer = &clps711x_timer, .restart = clps711x_restart, + .timer = &clps711x_timer, MACHINE_END diff --git a/arch/arm/mach-clps711x/clep7312.c b/arch/arm/mach-clps711x/clep7312.c index dbc7842..0301b2c 100644 --- a/arch/arm/mach-clps711x/clep7312.c +++ b/arch/arm/mach-clps711x/clep7312.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -33,14 +34,18 @@ fixup_clep7312(struct tag *tags, char **cmdline, struct meminfo *mi) mi->bank[0].size = 0x01000000; } +static void __init clep7312_init(void) +{ + platform_device_register_simple("uart-clps711x", 0, NULL, 0); +} MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312") /* Maintainer: Nobody */ .atag_offset = 0x0100, .fixup = fixup_clep7312, .map_io = clps711x_map_io, + .init_machine = clep7312_init, .init_irq = clps711x_init_irq, - .timer = &clps711x_timer, .restart = clps711x_restart, + .timer = &clps711x_timer, MACHINE_END - diff --git a/arch/arm/mach-clps711x/edb7211.c b/arch/arm/mach-clps711x/edb7211.c index 88f4690..119610b 100644 --- a/arch/arm/mach-clps711x/edb7211.c +++ b/arch/arm/mach-clps711x/edb7211.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -76,13 +77,19 @@ fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi) mi->nr_banks = 2; } +static void __init edb7211_init(void) +{ + platform_device_register_simple("uart-clps711x", 0, NULL, 0); +} + MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") /* Maintainer: Jon McClintock */ .atag_offset = VIDEORAM_SIZE + 0x100, .fixup = fixup_edb7211, - .map_io = edb7211_map_io, .reserve = edb7211_reserve, + .map_io = edb7211_map_io, + .init_machine = edb7211_init, .init_irq = clps711x_init_irq, - .timer = &clps711x_timer, .restart = clps711x_restart, + .timer = &clps711x_timer, MACHINE_END diff --git a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c index 3a3f0b7..a7f8305 100644 --- a/arch/arm/mach-clps711x/fortunet.c +++ b/arch/arm/mach-clps711x/fortunet.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -72,11 +73,17 @@ fortunet_fixup(struct tag *tags, char **cmdline, struct meminfo *mi) *mi = memmap; } +static void __init fortunet_init(void) +{ + platform_device_register_simple("uart-clps711x", 0, NULL, 0); +} + MACHINE_START(FORTUNET, "ARM-FortuNet") /* Maintainer: FortuNet Inc. */ .fixup = fortunet_fixup, .map_io = clps711x_map_io, + .init_machine = fortunet_init, .init_irq = clps711x_init_irq, - .timer = &clps711x_timer, .restart = clps711x_restart, + .timer = &clps711x_timer, MACHINE_END diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c index dd89950..96d54d4 100644 --- a/arch/arm/mach-clps711x/p720t.c +++ b/arch/arm/mach-clps711x/p720t.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -161,13 +162,19 @@ static int __init p720t_leds_init(void) fs_initcall(p720t_leds_init); #endif +static void __init p720t_init(void) +{ + platform_device_register_simple("uart-clps711x", 0, NULL, 0); +} + MACHINE_START(P720T, "ARM-Prospector720T") /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ .atag_offset = 0x100, .fixup = fixup_p720t, - .init_early = p720t_init_early, .map_io = p720t_map_io, + .init_early = p720t_init_early, + .init_machine = p720t_init, .init_irq = clps711x_init_irq, - .timer = &clps711x_timer, .restart = clps711x_restart, + .timer = &clps711x_timer, MACHINE_END diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c index a0a6db5..06f0e91 100644 --- a/drivers/tty/serial/clps711x.c +++ b/drivers/tty/serial/clps711x.c @@ -516,22 +516,6 @@ static struct platform_driver clps711x_uart_driver = { }; module_platform_driver(clps711x_uart_driver); -static struct platform_device clps711x_uart_device = { - .name = UART_CLPS711X_NAME, -}; - -static int __init uart_clps711x_init(void) -{ - return platform_device_register(&clps711x_uart_device); -} -module_init(uart_clps711x_init); - -static void __exit uart_clps711x_exit(void) -{ - platform_device_unregister(&clps711x_uart_device); -} -module_exit(uart_clps711x_exit); - MODULE_AUTHOR("Deep Blue Solutions Ltd"); MODULE_DESCRIPTION("CLPS711X serial driver"); MODULE_LICENSE("GPL");