Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp758790ybz; Wed, 15 Apr 2020 18:19:19 -0700 (PDT) X-Google-Smtp-Source: APiQypKnxoxDTKfTIIz2Cg7TcsWyOyAURMbybJMZqAIhe2iGR7G1DymxIwjpxqsBwcAcpMAafvtt X-Received: by 2002:a17:906:c9c1:: with SMTP id hk1mr7650732ejb.215.1586999959602; Wed, 15 Apr 2020 18:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586999959; cv=none; d=google.com; s=arc-20160816; b=f61igtS69jxD7AmINqM29GjK3nHdpRqETRBmOu5mRWlAYiCjV8vTaXHDJOYhxKpQc/ MhGpqGaPLj3TMydz7BbVOucZ640psOkhvo0zdaONqoHvNtNxAdhOMDOH6wZAo26eBKDa s9BF7xTvtx6LFNrft+W9w8LvVmOC4Y9Vy/SlRG4K8RMOmW1XXis4k6NOH4XQWeHXZ1M1 10I5LF/zw9S9U9gveXrB9JHS+yf4cdFmOl8Yb83A0aBGf2/4MGf3f9ujT3a5AT7aUnNQ O7Q7TC9+CGsvL2R4HwTXzNlkSfZmUQtmcekW6wG1eXD/6J6F0nguXOToWvuWZyRTjzzz 27vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:to :from; bh=q7Yqqcfulw7QJTWd/bvlw/JBfrM15NJiOz2H1aYLqC8=; b=zwnXhKMipkfXFbYSXHUW00QhfeCnWDL/xC6/Y6z0rSDDEl8z5gitNPBK0ncpFSzIRg G940aDEoMOeQIhM5EhHrX58zN5cU+jDvPkJ0Rv/cgNvagiTaousy6ee7OxpyL1l6DgGq f2n6wQRueayxv18VOYbtgvcWtJ6miqjjJ8dM6r6TW6V7XkPYw4dfSwnlWxAKmagWpfZq +WbgurJFFrwVEH+kD7GtshMWSNRH0jJVls4MzVNLN/SumozueFQgEjeqZP+ErL794muH WVf/gIOUvzYSqKaXncRBSll+pM/4huGSC18z7EG2lUgJROFwD3evX+v86qcEF4xDz/ht tGnQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o30si4097493eda.0.2020.04.15.18.18.57; Wed, 15 Apr 2020 18:19:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405841AbgDPBEB (ORCPT + 99 others); Wed, 15 Apr 2020 21:04:01 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2332 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728757AbgDPBD5 (ORCPT ); Wed, 15 Apr 2020 21:03:57 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 511AECE2DF5AD434AC1E; Thu, 16 Apr 2020 09:03:54 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Thu, 16 Apr 2020 09:03:44 +0800 From: Tian Tao To: , , , , , , , , , Subject: [PATCH v2] drm/hisilicon: Add the shutdown for hibmc_pci_driver Date: Thu, 16 Apr 2020 09:02:54 +0800 Message-ID: <1586998974-24234-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 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. v2: Remove the unnecessary unmap function. Signed-off-by: Tian Tao Reviewed-by: Sam Ravnborg --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index a6fd0c2..0250a10 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -337,7 +337,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev, dev->pdev = pdev; pci_set_drvdata(pdev, dev); - ret = pci_enable_device(pdev); + ret = pcim_enable_device(pdev); if (ret) { DRM_ERROR("failed to enable pci device: %d\n", ret); goto err_free; @@ -376,6 +376,11 @@ static void hibmc_pci_remove(struct pci_dev *pdev) drm_dev_put(dev); } +static void hibmc_pci_shutdown(struct pci_dev *pdev) +{ + hibmc_pci_remove(pdev); +} + static struct pci_device_id hibmc_pci_table[] = { { PCI_VDEVICE(HUAWEI, 0x1711) }, {0,} @@ -386,6 +391,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