From patchwork Wed Oct 23 10:41:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minghuan Lian X-Patchwork-Id: 3087791 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 EE7F69F2B8 for ; Wed, 23 Oct 2013 10:42:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE023202FF for ; Wed, 23 Oct 2013 10:42:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4F292030D for ; Wed, 23 Oct 2013 10:42:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753025Ab3JWKmK (ORCPT ); Wed, 23 Oct 2013 06:42:10 -0400 Received: from va3ehsobe001.messaging.microsoft.com ([216.32.180.11]:45630 "EHLO va3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752863Ab3JWKmJ (ORCPT ); Wed, 23 Oct 2013 06:42:09 -0400 Received: from mail78-va3-R.bigfish.com (10.7.14.227) by VA3EHSOBE003.bigfish.com (10.7.40.23) with Microsoft SMTP Server id 14.1.225.23; Wed, 23 Oct 2013 10:42:09 +0000 Received: from mail78-va3 (localhost [127.0.0.1]) by mail78-va3-R.bigfish.com (Postfix) with ESMTP id 358DF2008C; Wed, 23 Oct 2013 10:42:09 +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(zz154dIzz1f42h208ch1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz1de098h17326ah8275bh8275dh1de097h186068hz2dh2a8h839he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh1fb3h1d0ch1d2eh1d3fh1dfeh1dffh1e23h1fe8h1ff5h1155h) Received: from mail78-va3 (localhost.localdomain [127.0.0.1]) by mail78-va3 (MessageSwitch) id 1382524927997054_18185; Wed, 23 Oct 2013 10:42:07 +0000 (UTC) Received: from VA3EHSMHS013.bigfish.com (unknown [10.7.14.241]) by mail78-va3.bigfish.com (Postfix) with ESMTP id E66EB2E0099; Wed, 23 Oct 2013 10:42:07 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS013.bigfish.com (10.7.99.23) with Microsoft SMTP Server (TLS) id 14.16.227.3; Wed, 23 Oct 2013 10:42:07 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-005.039d.mgd.msft.net (10.84.1.17) with Microsoft SMTP Server (TLS) id 14.3.158.2; Wed, 23 Oct 2013 10:42:06 +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 r9NAfX7C020247; Wed, 23 Oct 2013 03:42:04 -0700 From: Minghuan Lian To: CC: Zang Roy-R61911 , Scott Wood , Kumar Gala , Bjorn Helgaas , , Minghuan Lian Subject: [PATCH 10/12][v3] pci: fsl: support function fsl_pci_assign_primary Date: Wed, 23 Oct 2013 18:41:32 +0800 Message-ID: <1382524894-15164-10-git-send-email-Minghuan.Lian@freescale.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1382524894-15164-1-git-send-email-Minghuan.Lian@freescale.com> References: <1382524894-15164-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% Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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: 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 0a0c240..40d2e1d 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -735,7 +735,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; } @@ -744,7 +745,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 729a5f4..8b4f793 100644 --- a/drivers/pci/host/pci-fsl-common.c +++ b/drivers/pci/host/pci-fsl-common.c @@ -634,7 +634,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", }, @@ -725,7 +725,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 bfb1f03..84b0801 100644 --- a/include/linux/fsl/pci-common.h +++ b/include/linux/fsl/pci-common.h @@ -136,6 +136,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