From patchwork Tue Apr 11 19:34:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 9676021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 808A6600CB for ; Tue, 11 Apr 2017 19:34:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7227B285AD for ; Tue, 11 Apr 2017 19:34:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66C83285B3; Tue, 11 Apr 2017 19:34:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DB24285AD for ; Tue, 11 Apr 2017 19:34:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752151AbdDKTew (ORCPT ); Tue, 11 Apr 2017 15:34:52 -0400 Received: from mail.kernel.org ([198.145.29.136]:60514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751900AbdDKTev (ORCPT ); Tue, 11 Apr 2017 15:34:51 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 603A12015A; Tue, 11 Apr 2017 19:34:49 +0000 (UTC) Received: from localhost (unknown [69.55.156.165]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2F44D2014A; Tue, 11 Apr 2017 19:34:48 +0000 (UTC) Date: Tue, 11 Apr 2017 14:34:47 -0500 From: Bjorn Helgaas To: Kishon Vijay Abraham I Cc: devicetree@vger.kernel.org, Joao Pinto , linux-doc@vger.kernel.org, linux-pci@vger.kernel.org, nsekhar@ti.com, linux-kernel@vger.kernel.org, hch@infradead.org, Bjorn Helgaas , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [GIT PULL] PCI: Support for configurable PCI endpoint Message-ID: <20170411193447.GA14778@bhelgaas-glaptop.roam.corp.google.com> References: <20170405085243.18123-1-kishon@ti.com> <20170410154328.GB13170@bhelgaas-glaptop.roam.corp.google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170410154328.GB13170@bhelgaas-glaptop.roam.corp.google.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Apr 10, 2017 at 10:43:28AM -0500, Bjorn Helgaas wrote: > On Wed, Apr 05, 2017 at 02:22:20PM +0530, Kishon Vijay Abraham I wrote: > > Hi Bjorn, > > > > Please find the pull request for PCI endpoint support below. I've > > also included all the history here. > > Thanks, I applied these (with v7 of the first patch) to pci/host-designware > for v4.12. Ok, sorry, I screwed this up. I think my branch actually had v5, not v6. But I *think* I fixed it. Here's the diff from my branch to your git tree. Apparently you haven't pushed the v7 patch there, so I *think* the diff below is the diff between v6 and v7 of that first patch. $ git diff pci/host-designware a5c85ba45c96 --- To unsubscribe from this list: send the line "unsubscribe linux-omap" 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/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c index caa7be10e473..9ae9e59b2a74 100644 --- a/drivers/pci/endpoint/pci-epc-core.c +++ b/drivers/pci/endpoint/pci-epc-core.c @@ -83,7 +83,6 @@ struct pci_epc *pci_epc_get(const char *epc_name) goto err; } - class_dev_iter_exit(&iter); get_device(&epc->dev); return epc; } diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c index 6877d6a5bcc9..92db7dcd911c 100644 --- a/drivers/pci/endpoint/pci-epf-core.c +++ b/drivers/pci/endpoint/pci-epf-core.c @@ -40,10 +40,8 @@ static struct device_type pci_epf_type; */ void pci_epf_linkup(struct pci_epf *epf) { - if (!epf->driver) { + if (!epf->driver) dev_WARN(&epf->dev, "epf device not bound to driver\n"); - return; - } epf->driver->ops->linkup(epf); } @@ -59,10 +57,8 @@ EXPORT_SYMBOL_GPL(pci_epf_linkup); */ void pci_epf_unbind(struct pci_epf *epf) { - if (!epf->driver) { + if (!epf->driver) dev_WARN(&epf->dev, "epf device not bound to driver\n"); - return; - } epf->driver->ops->unbind(epf); module_put(epf->driver->owner); @@ -78,10 +74,8 @@ EXPORT_SYMBOL_GPL(pci_epf_unbind); */ int pci_epf_bind(struct pci_epf *epf) { - if (!epf->driver) { + if (!epf->driver) dev_WARN(&epf->dev, "epf device not bound to driver\n"); - return -EINVAL; - } if (!try_module_get(epf->driver->owner)) return -EAGAIN; @@ -233,7 +227,7 @@ struct pci_epf *pci_epf_create(const char *name) epf->name = kstrdup(func_name, GFP_KERNEL); if (!epf->name) { ret = -ENOMEM; - goto free_func_name; + goto free_epf; } dev = &epf->dev; @@ -255,8 +249,6 @@ struct pci_epf *pci_epf_create(const char *name) put_dev: put_device(dev); kfree(epf->name); - -free_func_name: kfree(func_name); free_epf: