From patchwork Wed Jan 8 05:02:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minghuan Lian X-Patchwork-Id: 3451661 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B32EC9F1C4 for ; Wed, 8 Jan 2014 05:02:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BDDC620121 for ; Wed, 8 Jan 2014 05:02:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C80BA2010E for ; Wed, 8 Jan 2014 05:02:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752078AbaAHFCU (ORCPT ); Wed, 8 Jan 2014 00:02:20 -0500 Received: from ch1ehsobe002.messaging.microsoft.com ([216.32.181.182]:40295 "EHLO ch1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751821AbaAHFCT (ORCPT ); Wed, 8 Jan 2014 00:02:19 -0500 Received: from mail109-ch1-R.bigfish.com (10.43.68.230) by CH1EHSOBE002.bigfish.com (10.43.70.52) with Microsoft SMTP Server id 14.1.225.22; Wed, 8 Jan 2014 05:02:19 +0000 Received: from mail109-ch1 (localhost [127.0.0.1]) by mail109-ch1-R.bigfish.com (Postfix) with ESMTP id 8B560100300; Wed, 8 Jan 2014 05:02:15 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: -1 X-BigFish: VS-1(zz154dIzz1f42h2148h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h2189h1d1ah1d2ah1fc6hzz1de098h17326ah8275bh8275dh1de097h186068hz2dh2a8h839he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh2222h224fh1fb3h1d0ch1d2eh1d3fh1dfeh1dffh1e23h1fe8h1ff5h2218h2216h226dh22d0h2327h2336h1155h) Received: from mail109-ch1 (localhost.localdomain [127.0.0.1]) by mail109-ch1 (MessageSwitch) id 1389157324366806_17850; Wed, 8 Jan 2014 05:02:04 +0000 (UTC) Received: from CH1EHSMHS003.bigfish.com (snatpool2.int.messaging.microsoft.com [10.43.68.234]) by mail109-ch1.bigfish.com (Postfix) with ESMTP id 532A24E004A; Wed, 8 Jan 2014 05:02:04 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS003.bigfish.com (10.43.70.3) with Microsoft SMTP Server (TLS) id 14.16.227.3; Wed, 8 Jan 2014 05:02:03 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.3.158.2; Wed, 8 Jan 2014 05:02:02 +0000 Received: from lmh.ap.freescale.net (lmh.ap.freescale.net [10.193.20.65]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s0851V2L018463; Tue, 7 Jan 2014 22:01:59 -0700 From: Minghuan Lian To: CC: Zang Roy-R61911 , Scott Wood , Kumar Gala , Bjorn Helgaas , , Minghuan Lian Subject: [PATCH 10/12][v4] pci: fsl: support function fsl_pci_assign_primary Date: Wed, 8 Jan 2014 13:02:01 +0800 Message-ID: <1389157323-3088-10-git-send-email-Minghuan.Lian@freescale.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1389157323-3088-1-git-send-email-Minghuan.Lian@freescale.com> References: <1389157323-3088-1-git-send-email-Minghuan.Lian@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-FOPE-CONNECTOR: Id%0$Dn%FREESCALE.MAIL.ONMICROSOFT.COM$RO%1$TLS%0$FQDN%$TlsDn% Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, UNRESOLVED_TEMPLATE 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 Change pci_ids to fsl_pci_ids Freescale-specific name and change static to extern modifier for using in fsl_pci_assign_primary(). Signed-off-by: Minghuan Lian --- change log: v4: no change v1-v3: Derived from http://patchwork.ozlabs.org/patch/278965/ Based on upstream master. Based on the discussion of RFC version here http://patchwork.ozlabs.org/patch/274487/ arch/powerpc/sysdev/fsl_pci.c | 5 +++-- drivers/pci/host/pci-fsl-common.c | 4 ++-- include/linux/fsl/pci-common.h | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 38e8dca..6d9bec4 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -736,7 +736,8 @@ void fsl_pci_assign_primary(void) of_node_put(np); np = fsl_pci_primary; - if (of_match_node(pci_ids, np) && of_device_is_available(np)) + if (of_match_node(fsl_pci_ids, np) && + of_device_is_available(np)) return; } @@ -745,7 +746,7 @@ void fsl_pci_assign_primary(void) * designate one as primary. This can go away once * various bugs with primary-less systems are fixed. */ - for_each_matching_node(np, pci_ids) { + for_each_matching_node(np, fsl_pci_ids) { if (of_device_is_available(np)) { fsl_pci_primary = np; of_node_put(np); diff --git a/drivers/pci/host/pci-fsl-common.c b/drivers/pci/host/pci-fsl-common.c index e3696eb..0be7bc0 100644 --- a/drivers/pci/host/pci-fsl-common.c +++ b/drivers/pci/host/pci-fsl-common.c @@ -637,7 +637,7 @@ no_bridge: return -ENODEV; } -static const struct of_device_id pci_ids[] = { +const struct of_device_id fsl_pci_ids[] = { { .compatible = "fsl,mpc8540-pci", }, { .compatible = "fsl,mpc8548-pcie", }, { .compatible = "fsl,mpc8610-pci", }, @@ -728,7 +728,7 @@ static struct platform_driver fsl_pci_driver = { .driver = { .name = "fsl-pci", .pm = PCI_PM_OPS, - .of_match_table = pci_ids, + .of_match_table = fsl_pci_ids, }, .probe = fsl_pci_probe, .remove = fsl_pci_remove, diff --git a/include/linux/fsl/pci-common.h b/include/linux/fsl/pci-common.h index 8d33354..3247682 100644 --- a/include/linux/fsl/pci-common.h +++ b/include/linux/fsl/pci-common.h @@ -143,6 +143,8 @@ struct fsl_pci { void *sys; }; +extern const struct of_device_id fsl_pci_ids[]; + /* * Convert architecture specific pci controller structure to fsl_pci * PowerPC uses structure pci_controller and ARM uses structure pci_sys_data