From patchwork Tue Apr 19 18:19:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 92042 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 55AF1B6FF8 for ; Wed, 20 Apr 2011 04:19:13 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753493Ab1DSSTM (ORCPT ); Tue, 19 Apr 2011 14:19:12 -0400 Received: from pfepb.post.tele.dk ([195.41.46.236]:43764 "EHLO pfepb.post.tele.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753451Ab1DSSTM (ORCPT ); Tue, 19 Apr 2011 14:19:12 -0400 Received: from merkur.ravnborg.org (x1-6-c4-3d-c7-28-70-1a.k498.webspeed.dk [83.89.83.41]) by pfepb.post.tele.dk (Postfix) with ESMTP id 89225F84002; Tue, 19 Apr 2011 20:19:10 +0200 (CEST) Date: Tue, 19 Apr 2011 20:19:10 +0200 From: Sam Ravnborg To: Daniel Hellstrom , David Miller Cc: "David S. Miller" , sparclinux Subject: [PATCH 2/3] sparc32: cleanup code for pci init Message-ID: <20110419181910.GA20041@merkur.ravnborg.org> References: <20110418212248.GA13576@merkur.ravnborg.org> <1303161944-13611-2-git-send-email-sam@ravnborg.org> <4DAD4308.1090901@gaisler.com> <20110419181542.GA20033@merkur.ravnborg.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110419181542.GA20033@merkur.ravnborg.org> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org From: Sam Ravnborg Date: Sun, 17 Apr 2011 13:49:55 +0200 Subject: [PATCH 2/3] sparc32: cleanup code for pci init Move the ifdeffery to a header file to make the logic more obvious where we decide between PCI or SBUS init Signed-off-by: Sam Ravnborg --- Fixed so it now builds with or witout PCI enabled. Included the additional cleanup in time_32 as pointed out by Daniel. Sam -- 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/include/asm/pcic.h b/arch/sparc/include/asm/pcic.h index f20ef56..7eb5d78 100644 --- a/arch/sparc/include/asm/pcic.h +++ b/arch/sparc/include/asm/pcic.h @@ -29,11 +29,17 @@ 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 pci_time_init(void); extern void sun4m_pci_init_IRQ(void); - +#else +static inline int pcic_present(void) { return 0; } +static inline int pcic_probe(void) { return 0; } +static inline void pci_time_init(void) {} +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: diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c index 4e23639..b618403 100644 --- a/arch/sparc/kernel/time_32.c +++ b/arch/sparc/kernel/time_32.c @@ -228,14 +228,10 @@ static void __init sbus_time_init(void) void __init time_init(void) { -#ifdef CONFIG_PCI - extern void pci_time_init(void); - if (pcic_present()) { + if (pcic_present()) pci_time_init(); - return; - } -#endif - sbus_time_init(); + else + sbus_time_init(); }