From patchwork Tue Apr 19 08:08:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Hellstrom X-Patchwork-Id: 91931 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 85C26B6F18 for ; Tue, 19 Apr 2011 18:09:30 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753344Ab1DSIJ1 (ORCPT ); Tue, 19 Apr 2011 04:09:27 -0400 Received: from mail175c2.megamailservers.com ([69.49.111.75]:59842 "EHLO mail175c2.megamailservers.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753172Ab1DSIJZ (ORCPT ); Tue, 19 Apr 2011 04:09:25 -0400 X-Authenticated-User: daniel.gaisler.com Received: from [192.168.0.47] (gaisler.se [92.33.28.242]) (authenticated bits=0) by mail175c2.megamailservers.com (8.13.6/8.13.1) with ESMTP id p3J89Gek031879 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 19 Apr 2011 04:09:19 -0400 Message-ID: <4DAD4308.1090901@gaisler.com> Date: Tue, 19 Apr 2011 10:08:40 +0200 From: Daniel Hellstrom User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sam Ravnborg CC: "David S. Miller" , sparclinux Subject: Re: [PATCH 2/3] sparc32: cleanup code for irq init References: <20110418212248.GA13576@merkur.ravnborg.org> <1303161944-13611-2-git-send-email-sam@ravnborg.org> In-Reply-To: <1303161944-13611-2-git-send-email-sam@ravnborg.org> X-CSC: 0 X-CHA: v=1.1 cv=DS5eMQQtQ4nFbUAEtHoylkid/yBh9OhBXgXKFyMy8+c= c=1 sm=1 a=pl2ZPvC6udcA:10 a=H2L45UlztnMA:10 a=U62ajLuCel8A:10 a=8nJEP1OIZ-IA:10 a=jXKJviUpWSOlMmIvGrHOfw==:17 a=7gkXJVJtAAAA:8 a=TsyFDiNcjWBvSLvqAZoA:9 a=oYsYoax_vzsBqG_Mnl8A:7 a=wPNLvfGTeEIA:10 a=JmBWkid0h3cA:10 a=jXKJviUpWSOlMmIvGrHOfw==:117 Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org Sam Ravnborg wrote: >Move the iddef to a header file to make the logic more >obvious in the .c file > >Signed-off-by: Sam Ravnborg >--- > arch/sparc/include/asm/pcic.h | 10 +++++++--- > arch/sparc/kernel/irq_32.c | 9 +++------ > 2 files changed, 10 insertions(+), 9 deletions(-) > >diff --git a/arch/sparc/include/asm/pcic.h b/arch/sparc/include/asm/pcic.h >index f20ef56..b4c63d1 100644 >--- a/arch/sparc/include/asm/pcic.h >+++ b/arch/sparc/include/asm/pcic.h >@@ -29,11 +29,15 @@ struct linux_pcic { > int pcic_imdim; > }; > >-extern int pcic_probe(void); >-/* Erm... MJ redefined pcibios_present() so that it does not work early. */ >+#ifdef CONFIG_PCI > extern int pcic_present(void); >+extern int pcic_probe(void); > extern void sun4m_pci_init_IRQ(void); >- >+#else >+extern int pcic_present(void) { return 0; } > > typo, it should be static inline int pcic_preset... will not compile otherwise. >+static inline int pcic_probe(void) { return 0; } >+static inline void sun4m_pci_init_IRQ(void) {} >+#endif > #endif > > /* Size of PCI I/O space which we relocate. */ >diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c >index 7c93df4..b2dbb4b 100644 >--- a/arch/sparc/kernel/irq_32.c >+++ b/arch/sparc/kernel/irq_32.c >@@ -607,14 +607,11 @@ void __init init_IRQ(void) > break; > > case sun4m: >-#ifdef CONFIG_PCI > pcic_probe(); >- if (pcic_present()) { >+ if (pcic_present()) > sun4m_pci_init_IRQ(); >- break; >- } >-#endif >- sun4m_init_IRQ(); >+ else >+ sun4m_init_IRQ(); > break; > > case sun4d: > > Similarily you can add "static inline void pci_time_init(void) {};" and remove the CONFIG_PCI in time_32.c? Daniel --- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c index ffcf7b5..3db2b06 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c @@ -228,17 +228,13 @@ static void __init sbus_time_init(void) void __init time_init(void) { -#ifdef CONFIG_PCI - extern void pci_time_init(void); if (pcic_present()) { pci_time_init(); return; } -#endif sbus_time_init(); } - static int set_rtc_mmss(unsigned long secs) { struct rtc_device *rtc = rtc_class_open("rtc0");