From patchwork Mon Oct 20 02:19:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 5101881 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BF6D6C11AD for ; Mon, 20 Oct 2014 02:51:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E1032201B9 for ; Mon, 20 Oct 2014 02:51:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1790F201F2 for ; Mon, 20 Oct 2014 02:51:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752127AbaJTCvf (ORCPT ); Sun, 19 Oct 2014 22:51:35 -0400 Received: from [207.46.100.106] ([207.46.100.106]:8224 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752031AbaJTCvc (ORCPT ); Sun, 19 Oct 2014 22:51:32 -0400 Received: from BN3PR0301CA0070.namprd03.prod.outlook.com (25.160.152.166) by BY1PR0301MB0855.namprd03.prod.outlook.com (25.160.193.149) with Microsoft SMTP Server (TLS) id 15.0.1054.13; Mon, 20 Oct 2014 02:49:39 +0000 Received: from BN1AFFO11FD045.protection.gbl (2a01:111:f400:7c10::188) by BN3PR0301CA0070.outlook.office365.com (2a01:111:e400:401e::38) with Microsoft SMTP Server (TLS) id 15.0.1054.13 via Frontend Transport; Mon, 20 Oct 2014 02:49:39 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD045.mail.protection.outlook.com (10.58.53.60) with Microsoft SMTP Server (TLS) id 15.0.1049.20 via Frontend Transport; Mon, 20 Oct 2014 02:49:38 +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 s9K2nUu2019728; Sun, 19 Oct 2014 19:49:33 -0700 Received: by shlinux1.ap.freescale.net (Postfix, from userid 1003) id D91AE1AE20A; Mon, 20 Oct 2014 10:19:17 +0800 (CST) From: Richard Zhu To: CC: , , , , Richard Zhu Subject: [PATCH v7 02/13] PCI: designware: Set func type of host init to int Date: Mon, 20 Oct 2014 10:19:05 +0800 Message-ID: <1413771556-32212-3-git-send-email-richard.zhu@freescale.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1413771556-32212-1-git-send-email-richard.zhu@freescale.com> References: <1413771556-32212-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)(85852003)(16796002)(31966008)(88136002)(44976005)(19580395003)(6806004)(68736004)(87936001)(69596002)(19580405001)(52956003)(89996001)(84676001)(87286001)(110136001)(80022003)(46102003)(33646002)(47776003)(20776003)(4396001)(64706001)(95666004)(76482002)(103686003)(229853001)(2351001)(107046002)(105586002)(81156004)(106466001)(99396003)(97736003)(120916001)(26826002)(102836001)(101416001)(76176999)(50986999)(50466002)(48376002)(93916002)(575784001)(92566001)(92726001)(77096002)(50226001)(85306004)(21056001)(42186005)(104166001)(62966002)(45336002)(77156001)(36756003)(46386002)(90966001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR0301MB0855; 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:BY1PR0301MB0855; X-Forefront-PRVS: 03706074BC 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=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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);