From patchwork Wed Nov 15 04:56:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oza Pawandeep X-Patchwork-Id: 10058843 X-Patchwork-Delegate: agross@codeaurora.org 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 B611F6023A for ; Wed, 15 Nov 2017 04:57:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA40229D34 for ; Wed, 15 Nov 2017 04:57:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F18729DB7; Wed, 15 Nov 2017 04:57:08 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 5322B29D34 for ; Wed, 15 Nov 2017 04:57:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754488AbdKOE5H (ORCPT ); Tue, 14 Nov 2017 23:57:07 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:38858 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752233AbdKOE5G (ORCPT ); Tue, 14 Nov 2017 23:57:06 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C520860860; Wed, 15 Nov 2017 04:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510721825; bh=0yIXsetSK0NaBHRFwpm6ZKl7jfHo2UpODO72sDKu9yQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bKy75TMkICc7AMmCsZ8+j7W02i+iJirbol6f5/6Q1p5E7trRQRwYPuas50ImibOpN nAdND/htJ2LBExZSoSWdilPOy1+ZrzamKVT8HSPUfKq3Ua2xXHggxy5ebdBVvi0UBw ZDbp+/4pTC5pkwnHaU6ao1hgj9xdRnuDHMYDjRc8= Received: from blr-ubuntu-poza.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: poza@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E30ED60860; Wed, 15 Nov 2017 04:57:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510721824; bh=0yIXsetSK0NaBHRFwpm6ZKl7jfHo2UpODO72sDKu9yQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k60tgfQidL6X1FLdeS6US8Bw8I48TzJr/Vkv7m20uKHFMDT6Vw1qGFdxNd6laEcrt wTkuZIGnXHQfDcM7k0OX+Ffj7IHiY0MBjMPVdut1rySd+lMVikER5CJ3iH0d37yPtJ xj+xc8IunoZl77X9WGiF/IBZumuvLSe0etd81xIA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E30ED60860 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=poza@codeaurora.org From: Oza Pawandeep To: linux-pci@vger.kernel.org, okaya@codeaurora.org, timur@codeaurora.org Cc: Bjorn Helgaas , Dongdong Liu , Gabriele Paoloni , Thomas Gleixner , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Oza Pawandeep Subject: [PATCH v2 2/4] PCI/portdrv: Add/Remove port services to the list Date: Wed, 15 Nov 2017 10:26:46 +0530 Message-Id: <1510721808-27164-3-git-send-email-poza@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510721808-27164-1-git-send-email-poza@codeaurora.org> References: <1510721808-27164-1-git-send-email-poza@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds and removes the port service to the service list. Signed-off-by: Oza Pawandeep diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index a592103..6bfe986 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -454,6 +454,8 @@ static int pcie_port_probe_service(struct device *dev) if (status) return status; + list_add_tail(&pciedev->slist, &pciedev->port->service_list); + get_device(dev); return 0; } @@ -477,6 +479,9 @@ static int pcie_port_remove_service(struct device *dev) pciedev = to_pcie_device(dev); driver = to_service_driver(dev->driver); + + list_del(&pciedev->slist); + if (driver && driver->remove) { driver->remove(pciedev); put_device(dev); diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index b69769d..9d05621 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h @@ -31,6 +31,7 @@ struct pcie_device { u32 service; /* Port service this device represents */ void *priv_data; /* Service Private Data */ struct device device; /* Generic Device Interface */ + struct list_head slist; /* List of services */ }; #define to_pcie_device(d) container_of(d, struct pcie_device, device)