Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1398432ybk; Thu, 14 May 2020 08:04:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkIAuIdNJW1/ywkZZ0/sBkfUnh5TuCg6Dp5x8nKyevbkGKMt4VmZQAnOQIf+67qOKRvjW/ X-Received: by 2002:a50:d54f:: with SMTP id f15mr4531152edj.37.1589468640438; Thu, 14 May 2020 08:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589468640; cv=none; d=google.com; s=arc-20160816; b=KqbP26zfd3mjN7tmyxKZUrllByJpCsCHUR74TthDN1G+Gu1yot3DNw0l9y4zaHcQSu VoaaIh9Ouj0OAiysrXokMQ35KHB4wU23CG0GlrXVvlkcn4j/yMy19/pJO9Zkbjf8z7ms wTB/zeimEIQNlrMDAG94JKyFmb/1pbvN4xRgkGP9s6Dcc2G8zViwtpFc96mZviHEue3/ D1KJG6jtY+Iyg3qqRrjcBMV8PgXjUUHWgQ8AxlgZm1uEBmr9pnITV2nVmLQ6jwzVNJa9 I42i4SJuLu2FOBS3uPDKKlD75MEN5ySuJtCtzq3LC5x2BH7DzlgAPBA/PZ05/Z9a+qEp PIGg== 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=3kot24pT8I54Qo+jrpEa45lAzMIAEzTZmm1JUxN+Bjc=; b=koU2q6lFsjnIxDy620FRFGH2dbU/LVWV7eISlXztOVHc/zd/H+Qy02zEzD9o8hzZ35 Z/MYNXwWYpJurlBUoj5axC5Q+hm9V7cIbuCDAACmTRfJREQjMQRYmvsTS+Quy1iZJLGQ NAoVd2SlDg3UUAY9IeM4F/IB0GDLkL5natf7LDLcsCiXBxuRQUnxgxkUirtKuRJoX5CP T6Gh8d3WSkjxILPoWNtmJ4JdqT1zE4HYiCxA7usxLY3UcCHzV40fKf5D6oL9QN6kOyJq BQWqSvlYVbVDFhr1TYGRBciTPkMIbzpXJRFKblqs1oPc7i/Tw4zYyHVlzN+3Mk/B1UYP xllw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="Ld4YaDO/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id v23si2070005ejo.321.2020.05.14.08.03.36; Thu, 14 May 2020 08:04:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="Ld4YaDO/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728283AbgENPB1 (ORCPT + 99 others); Thu, 14 May 2020 11:01:27 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:42282 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727123AbgENPBY (ORCPT ); Thu, 14 May 2020 11:01:24 -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 04EF0Z7o029269; Thu, 14 May 2020 10:00:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1589468435; bh=3kot24pT8I54Qo+jrpEa45lAzMIAEzTZmm1JUxN+Bjc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Ld4YaDO/ufrRparGyNG/IyBUN/95uQw4hpuKaFIpoG1jGzOCx133M/kZcsqCyV+kj QgguIenZsF00Rg/954KX15zsVccuq9ZfIIUukgN75a4SKjMerpjsI21OcQ0gQVtbRj B5kWIsmUtKeAJNKrOX6eTKFGISOtv/aCrlkbcrMg= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 04EF0ZGx129334; Thu, 14 May 2020 10:00:35 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 14 May 2020 10:00:34 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Thu, 14 May 2020 10:00:34 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 04EExgAs019279; Thu, 14 May 2020 10:00:30 -0500 From: Kishon Vijay Abraham I To: Lorenzo Pieralisi , Arnd Bergmann , Jon Mason , Dave Jiang , Allen Hubbe , Tom Joseph , Bjorn Helgaas , Rob Herring CC: Greg Kroah-Hartman , Jonathan Corbet , , , , , , Kishon Vijay Abraham I Subject: [PATCH 10/19] PCI: endpoint: Make pci_epf_driver ops optional Date: Thu, 14 May 2020 20:29:18 +0530 Message-ID: <20200514145927.17555-11-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200514145927.17555-1-kishon@ti.com> References: <20200514145927.17555-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 f9ba2e8d4a99..f463eedcc3ad 100644 --- a/drivers/pci/endpoint/pci-epf-core.c +++ b/drivers/pci/endpoint/pci-epf-core.c @@ -201,11 +201,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