From patchwork Fri Aug 18 14:57:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 110399 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp935169obb; Fri, 18 Aug 2017 07:58:51 -0700 (PDT) X-Received: by 10.98.204.10 with SMTP id a10mr9294261pfg.332.1503068331075; Fri, 18 Aug 2017 07:58:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503068331; cv=none; d=google.com; s=arc-20160816; b=iSodwKgXEbGrzE+nm/+vvsYX613LiiV52bG2b0bPb9af4K8WWe3Ha1c5+LL8AxbuEx 3vIDTp1MLcXsUhGvdDZidL0YIElNiVev3XzvCwnQIDdd3mJ42NvMkiNeaX57QAvWdvc9 gWGE04MeJU1pmuPr9TIxW85x5UkFf7YiM0tQdBaeTWxb0tpGLDzZMGl0MIZYh8XdDjl3 xsqeTDTDxXQD/GzAEnS85AtQHiaDLUKszYeBt0gZJuPnswJ8xea7W9rQ2Wf1s0Sp7mWk 7ejMQy1XmVDYM7ZDv5YEzFoMbbl8dTbG9gZvl15W5Zr0EZX90kP+86Clb7lvpJ74cSDO coEA== 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 :arc-authentication-results; bh=YMTWjWdsm/Wrxpdkfc/Y5xVAsXZH9UI0yI9xQy+UJBU=; b=du8xguSJ6smPwzewi2LisOxg1X7m3iT9t4849q6WYdzO4C8OnyYW/zO7gYZ7pbIoDu e50p2VUZtBTolsnwNTT4HQwU7rzWIn1EJKFvccRryOXK8DvP4Nd3gE0Io6dt/UykKIOT aKVNnnKd6qHxK38IGgglicoR1vHfxr3YTIf/R5+19dgMFexz4bWSEMMKaw0ameS/6dqf JRT6Kv3j1QH7ctLl2Z+EGHC31EamzfpcLdMCVwypSeFyMiTg4FhI0/KfaoHMh1rwxgp4 m8mBdB5lJWXmBvI4v9pgdsnmmN3Ns/K5t+Md2SN/y//AVesGcE/hkRT/H9i3VYQg9e5O 2+2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ybTgLEX0; 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 w12si3648674pge.639.2017.08.18.07.58.50; Fri, 18 Aug 2017 07:58:51 -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=ybTgLEX0; 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 S1752280AbdHRO6q (ORCPT + 26 others); Fri, 18 Aug 2017 10:58:46 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:19578 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751169AbdHRO6k (ORCPT ); Fri, 18 Aug 2017 10:58:40 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v7IEwW7k007546; Fri, 18 Aug 2017 09:58:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1503068312; bh=WfLmrm5tgta8wN5sD21ZiQmst2rR1av3wcCuKTs28qE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ybTgLEX0Lc+i1IJ+smmjVbxFr5OksUS/XI/CT8wp1PW66YaQHU6sINKLJtMW4VxXz U6yjxbfnsOqPsF89+LvYCV6W/nKQe6UdVx7cY69alF261Lnm39vISakiDrzEMDgNaN vp10LtFbIqhQFB4/bPXQuOjvmkcjNGdfRrCzNZ3k= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v7IEwWKP002765; Fri, 18 Aug 2017 09:58:32 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Fri, 18 Aug 2017 09:58:32 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Fri, 18 Aug 2017 09:58:31 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Fri, 18 Aug 2017 09:58:31 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v7IEwKk1023721; Fri, 18 Aug 2017 09:58:29 -0500 From: Kishon Vijay Abraham I To: Bjorn Helgaas CC: Joao Pinto , Arnd Bergmann , , , , , , Subject: [PATCH 03/18] PCI: endpoint: pci-epf-core: Make ->remove() callback optional Date: Fri, 18 Aug 2017 20:27:55 +0530 Message-ID: <20170818145810.17649-4-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170818145810.17649-1-kishon@ti.com> References: <20170818145810.17649-1-kishon@ti.com> MIME-Version: 1.0 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 Make ->remove() callback optional so that endpoint function drivers don't have to populate empty ->remove() callback functions. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/endpoint/pci-epf-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c index 60ea0c51161e..ae6fac5995e3 100644 --- a/drivers/pci/endpoint/pci-epf-core.c +++ b/drivers/pci/endpoint/pci-epf-core.c @@ -333,11 +333,12 @@ static int pci_epf_device_probe(struct device *dev) static int pci_epf_device_remove(struct device *dev) { - int ret; + int ret = 0; struct pci_epf *epf = to_pci_epf(dev); struct pci_epf_driver *driver = to_pci_epf_driver(dev->driver); - ret = driver->remove(epf); + if (driver->remove) + ret = driver->remove(epf); epf->driver = NULL; return ret;