Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6387807ybf; Thu, 5 Mar 2020 19:44:10 -0800 (PST) X-Google-Smtp-Source: ADFU+vuit+OGTkFXkJwCfLCr6Od40jgRpHMPkkL/P1FP7UwACFtb61WTBotnqEGDdmU2e+87yu9I X-Received: by 2002:aca:d64f:: with SMTP id n76mr1176615oig.175.1583466249925; Thu, 05 Mar 2020 19:44:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583466249; cv=none; d=google.com; s=arc-20160816; b=CfWrP0ouX+Qbs7fXlO6cY2Rcaz2VX1gf/2x6O3maaQXXJN4N/ZOodN1TQqKjvQT3pA d1i3UirvbYAO/OEFFgankrN21iBXtZ5joVETRn4tvXrsXTTYMNzYWOvirx8OyBSAcQ0N FVkAp/8DsQjZ0oEhBuGftnGoaE0ScQVB9QjNerakdwpZn+BToHfJhKDUabdCXdFHSnxY YbqAM7gNF5Rxf56QrnUhTFyQQ27Cpc7+j2JsRg0PbHK1tiiuyECRFbZe7liir0U79a+J w+vUkxsDKTpIPNmwVSplA3kOf6Izxxyv4Z1Xyecwr84ywRtpAyKT/yDyZMR8bRD0ymrf MbqA== 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=dPzwx73kB8kGuwDhaqkHre4BOtznlCCxDeQ6ZUvU8QJDzdNcD4of7Fz6BM8Ql1wXKk l7sqGC1r2RyTp2nhd2H7+LEFdo7V50ctscZ3oTlbgEl3w6dMyhI1iik1ZOwY5/zrDNJO 16caCaeAG++nBClv6B8Cz59J5iauD/wGYh01+WQtuaaCBOGXiaioukxYamedEu2RM+AX X2OeJ1ZRNRuqYCyK+Uoeyi3O1G2+eYDHXcCaExw1+R2YejV35C++lW0CuvZ3sJlxaPSP 6JjWqbNR0OuJ7IkNUMmdf861O2pxqLWpq3bzs20HhBUjcEli9ceAmgMQrRSx2EIqOkIg XHnA== 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 v6si605280oia.200.2020.03.05.19.43.57; Thu, 05 Mar 2020 19:44:09 -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 S1726861AbgCFDnn (ORCPT + 99 others); Thu, 5 Mar 2020 22:43:43 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:11176 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726300AbgCFDnn (ORCPT ); Thu, 5 Mar 2020 22:43:43 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 6FB5A929005F8E638F16; 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:33 +0800 From: Tian Tao To: , , , , , , , , , CC: Subject: [PATCH 4/4] drm/hisilicon: Add the shutdown for hibmc_pci_driver Date: Fri, 6 Mar 2020 11:43:04 +0800 Message-ID: <1583466184-7060-7-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