Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1936221ybn; Thu, 26 Sep 2019 04:35:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAhs9G6DNVzV3TKGseuKAFzrN1XJqGxxWsjP9H/gUW9oWXXTVRgtTg81iQnJG0akpqKcQN X-Received: by 2002:aa7:d48f:: with SMTP id b15mr3020493edr.159.1569497734539; Thu, 26 Sep 2019 04:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569497734; cv=none; d=google.com; s=arc-20160816; b=jPC7H+Uj6ZWoQOpi9V6+ZcHOQ+5eGWf7sN5IH9NzZ0/28oML1NFec+RC3dS1h9jjDf CZPMEuvCZkItXFmu/Kz0mcC2WsGvEmrj22RZrvSPY/BaOhnEYAiiXlpLzB0k3AlM4i2k scvXTBV2mhG4a+Wgun04kVWKL5fLePf3BP5CzdeHVG99pPKZ7BaTh3a00DvlWbxQPhrS WUp7n4iZnS4gX8/gs/2VJHSoKiyJ8E2GeyFsxnhYZQ0Oa4LKtRvETa2Xqk++96EE9jj6 /zmcDqjQjoV4YL5w/60E1gkr19oLemcXIfwhHmtp9KgmibdEY3+WYXp/ljgG7Z0eEEhM UZ6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=E2GTTExAvbZbBjqJm7peVu26RwtsAEY0HmYYy9aUZio=; b=WKRvAjFh8BuAAQH2qm6qQZ3Y26fMkD+CdKE3sIL6t0ChMBpWOyD6T0kIBRxOfZBPrf r9tOGrSPo56+908BbKkYw9GUmQ1shk4lOAN2hbdp82uzCmUX39uZiVoHmIGA7lp5sdV3 wxqp69At/6DO8zKH2shmxXU99a5D93CeoORsQorRJP3P/Nok8C3+EH4vX6YIXuXRr3jB A6uyVhB4ua+DQA6i0KABA4mdbctR9gkJyfS+g7X5K0vLmLYUhM/eT9ZS4dsXdaM7BiYw xrJ7zLjb7yd/HkuUb41QNpEbgpGPMPBtSNh+6y6F3so8tvfNX0wliQe/C7raff+4jV2q ZFng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="Sc6WLz/r"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d4si859584ejy.154.2019.09.26.04.35.10; Thu, 26 Sep 2019 04:35:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="Sc6WLz/r"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726563AbfIZLb1 (ORCPT + 99 others); Thu, 26 Sep 2019 07:31:27 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:51028 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726030AbfIZLbX (ORCPT ); Thu, 26 Sep 2019 07:31:23 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x8QBVGt5042493; Thu, 26 Sep 2019 06:31:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1569497476; bh=E2GTTExAvbZbBjqJm7peVu26RwtsAEY0HmYYy9aUZio=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Sc6WLz/rgCEjTalAjHyyN/dl7vJRBPT5G+xMCus7Zdk+xUmOS/jli4Wl1k39juA5g NqqLx7JqQXazDe/Uwihqes0fkvz0VlyzEoKmz7611/wgXt1IJjHEjjIhu9ci208c0R K0uutCj06xnxsrpSCNJxwnjOpoe43EMooUR/B+is= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id x8QBVGH3013966; Thu, 26 Sep 2019 06:31:16 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 26 Sep 2019 06:31:15 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 26 Sep 2019 06:31:08 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x8QBUTk3069017; Thu, 26 Sep 2019 06:31:12 -0500 From: Kishon Vijay Abraham I To: Bjorn Helgaas , Jonathan Corbet , Rob Herring , Jon Mason , Dave Jiang , Allen Hubbe , Lorenzo Pieralisi CC: Mark Rutland , , , , , , Subject: [RFC PATCH 10/21] PCI: endpoint: Make pci_epf_driver ops optional Date: Thu, 26 Sep 2019 16:59:22 +0530 Message-ID: <20190926112933.8922-11-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926112933.8922-1-kishon@ti.com> References: <20190926112933.8922-1-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pci_epf_driver had two ops for bind and unbind which will be invoked when an endpoint controller is bound to an endpoint function (using configfs). Now that endpoint core has support to define an endpoint function using device tree alone, the bind and unbind ops can be optional. Make pci_epf_driver ops optional here. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/endpoint/pci-epf-core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c index c74c7cc6d8bd..67015c66d09f 100644 --- a/drivers/pci/endpoint/pci-epf-core.c +++ b/drivers/pci/endpoint/pci-epf-core.c @@ -446,11 +446,9 @@ int __pci_epf_register_driver(struct pci_epf_driver *driver, { int ret; - if (!driver->ops) - return -EINVAL; - - if (!driver->ops->bind || !driver->ops->unbind) - return -EINVAL; + if (!driver->ops || !driver->ops->bind || !driver->ops->unbind) + pr_debug("%s: Supports only pci_epf device created using DT\n", + driver->driver.name); driver->driver.bus = &pci_epf_bus_type; driver->driver.owner = owner; -- 2.17.1