From patchwork Thu Oct 16 07:52:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 5088851 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 3EDD09FAB2 for ; Thu, 16 Oct 2014 08:23:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73738201CE for ; Thu, 16 Oct 2014 08:23:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 97745201CD for ; Thu, 16 Oct 2014 08:23:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751334AbaJPIXR (ORCPT ); Thu, 16 Oct 2014 04:23:17 -0400 Received: from mail-by2on0110.outbound.protection.outlook.com ([207.46.100.110]:52768 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751202AbaJPIXJ (ORCPT ); Thu, 16 Oct 2014 04:23:09 -0400 Received: from BY2PR03CA067.namprd03.prod.outlook.com (10.141.249.40) by BN3PR0301MB0850.namprd03.prod.outlook.com (25.160.154.148) with Microsoft SMTP Server (TLS) id 15.0.1054.13; Thu, 16 Oct 2014 08:23:04 +0000 Received: from BY2FFO11FD004.protection.gbl (2a01:111:f400:7c0c::181) by BY2PR03CA067.outlook.office365.com (2a01:111:e400:2c5d::40) with Microsoft SMTP Server (TLS) id 15.0.1054.13 via Frontend Transport; Thu, 16 Oct 2014 08:23:03 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD004.mail.protection.outlook.com (10.1.14.158) with Microsoft SMTP Server (TLS) id 15.0.1039.16 via Frontend Transport; Thu, 16 Oct 2014 08:23:03 +0000 Received: from shlinux1.ap.freescale.net (shlinux1.ap.freescale.net [10.192.225.216]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s9G8N2nj027295; Thu, 16 Oct 2014 01:23:02 -0700 Received: by shlinux1.ap.freescale.net (Postfix, from userid 1003) id D35451AE20B; Thu, 16 Oct 2014 15:52:46 +0800 (CST) From: Richard Zhu To: CC: , , , , Richard Zhu Subject: [PATCH v6 02/13] PCI: designware: Set func type of host init to int Date: Thu, 16 Oct 2014 15:52:32 +0800 Message-ID: <1413445963-24706-3-git-send-email-richard.zhu@freescale.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1413445963-24706-1-git-send-email-richard.zhu@freescale.com> References: <1413445963-24706-1-git-send-email-richard.zhu@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(428002)(199003)(189002)(103686003)(36756003)(26826002)(80022003)(101416001)(575784001)(102836001)(95666004)(76482002)(105586002)(46102003)(120916001)(99396003)(92726001)(64706001)(84676001)(20776003)(21056001)(47776003)(50986999)(92566001)(87286001)(2351001)(107046002)(87936001)(77156001)(89996001)(76176999)(88136002)(52956003)(50466002)(31966008)(16796002)(93916002)(229853001)(81156004)(85852003)(104166001)(106466001)(77096002)(69596002)(48376002)(68736004)(46386002)(6806004)(85306004)(97736003)(45336002)(62966002)(44976005)(19580405001)(19580395003)(42186005)(50226001)(110136001)(33646002)(4396001)(90966001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR0301MB0850; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; A:0; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BN3PR0301MB0850; X-Forefront-PRVS: 036614DD9C Received-SPF: None (protection.outlook.com: shlinux1.ap.freescale.net does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is 192.88.158.2) smtp.mailfrom=r65037@shlinux1.ap.freescale.net; X-OriginatorOrg: freescale.com Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY 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 host init maybe failed, change the func type of host_init defined in struct pci_host_ops from void to int. Signed-off-by: Richard Zhu --- drivers/pci/host/pcie-designware.c | 7 +++++-- drivers/pci/host/pcie-designware.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index b1f82ff..1a2b477 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -578,8 +578,11 @@ int __init dw_pcie_host_init(struct pcie_port *pp) } } - if (pp->ops->host_init) - pp->ops->host_init(pp); + if (pp->ops->host_init) { + ret = pp->ops->host_init(pp); + if (ret < 0) + return ret; + } dw_pcie_wr_own_conf(pp, PCI_BASE_ADDRESS_0, 4, 0); diff --git a/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h index b0bfed0..57ab11d 100644 --- a/drivers/pci/host/pcie-designware.h +++ b/drivers/pci/host/pcie-designware.h @@ -72,7 +72,7 @@ struct pcie_host_ops { int (*wr_other_conf)(struct pcie_port *pp, struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); int (*link_up)(struct pcie_port *pp); - void (*host_init)(struct pcie_port *pp); + int (*host_init)(struct pcie_port *pp); void (*msi_set_irq)(struct pcie_port *pp, int irq); void (*msi_clear_irq)(struct pcie_port *pp, int irq); u32 (*get_msi_data)(struct pcie_port *pp);