Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6388175ybf; Thu, 5 Mar 2020 19:44:42 -0800 (PST) X-Google-Smtp-Source: ADFU+vs5vS9cLC+69JaqBS1LhKrpVIa9tTkGAZxq4DFXX2MQnrv/7GTtV0esTQxgcR2NE79/iUSt X-Received: by 2002:a05:6808:56:: with SMTP id v22mr1187776oic.116.1583466282854; Thu, 05 Mar 2020 19:44:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583466282; cv=none; d=google.com; s=arc-20160816; b=ephQ1X3fRQPxydSIoO66j+/LPBsvyceNzdWhykBw1kT3b6+Msl4jFpyrHog8JDWWW+ 7nlosh2hJtzzoSFQV3UqpxkkzZrJw7M0NrKm1x2RbjQEz1Bb29Herb9Nh1h0UaEkTHiv kkfkfirBEhmwPTjK4wXY17in78SVwlR/1k/nr27x5J3lR1Zmp7G/BtpW57FRJaNwQr0M 5tiz7FgV6e0g9uD7woQhX9xlq6p7213Cd1ph/aPNQ+Zr1tcrTlqaHb7OwFv/NZmdtRIG lKN3/OwysZiSQsrRF0F07gUePWaYpcAZrJ86jPg0vHT0WLQxNqk0ClY64wwGjkEl6Gn8 ajow== 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; bh=kxou1lhyPspL8r8x/txiOoi0s7my/cSeAKVf1TGOj2c=; b=The+aU82arQJk3uWmpqPtdH30uIxxBrQ8fLsGl+pO5HwZGAYY4kGgQB7blcELS/6nN g3xbVTGeA+NPOw4t5S39wcasB6vzn/xntLSa508MLTLv1AF6TtzEZCVCcWjL91dtOOat j2FOe8Yi7qNRfa+Tr6O30fo5UXLbR/9lHb1IkzwmR04Wnr3C90QJcdffBTRrcKJwbigt EqJ0gj2349uGId9Z1ZT6vHeQkH2xkflSwQeBdWi+qWbtYNVrVzBk3bJ/UopfNDEc9eWL GQVC5l6AbNsXARUB8CXjlKvSYMx78tVYyvIoZNLuMlmpS9IpvGVxpALky2SW7/0gHgIi XvCg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si561596oto.221.2020.03.05.19.44.30; Thu, 05 Mar 2020 19:44:42 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726579AbgCFDnn (ORCPT + 99 others); Thu, 5 Mar 2020 22:43:43 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:11177 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726243AbgCFDnm (ORCPT ); Thu, 5 Mar 2020 22:43:42 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 751C6251BD32DA691400; Fri, 6 Mar 2020 11:43:40 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Fri, 6 Mar 2020 11:43:31 +0800 From: Tian Tao To: , , , , , , , , , CC: Subject: [PATCH] drm/hisilicon: Add the shutdown for hibmc_pci_driver Date: Fri, 6 Mar 2020 11:42:59 +0800 Message-ID: <1583466184-7060-2-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583466184-7060-1-git-send-email-tiantao6@hisilicon.com> References: <1583466184-7060-1-git-send-email-tiantao6@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org add the shutdown function to release the resource. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index 51f1c70..0e58455d 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -357,9 +357,14 @@ static void hibmc_pci_remove(struct pci_dev *pdev) { struct drm_device *dev = pci_get_drvdata(pdev); - drm_dev_unregister(dev); - hibmc_unload(dev); drm_dev_put(dev); + pci_disable_device(pdev); + +} + +static void hibmc_pci_shutdown(struct pci_dev *pdev) +{ + hibmc_pci_remove(pdev); } static struct pci_device_id hibmc_pci_table[] = { @@ -372,6 +377,7 @@ static struct pci_driver hibmc_pci_driver = { .id_table = hibmc_pci_table, .probe = hibmc_pci_probe, .remove = hibmc_pci_remove, + .shutdown = hibmc_pci_shutdown, .driver.pm = &hibmc_pm_ops, }; -- 2.7.4