Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4909117pxu; Tue, 22 Dec 2020 03:59:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyeCk2tDONqHQd/4coXnCP1SWdym59S/Gb2XAkVvyguZ1op7CCYFfU/HB4ZElebzfAwAUDn X-Received: by 2002:a17:906:1741:: with SMTP id d1mr9310911eje.182.1608638394298; Tue, 22 Dec 2020 03:59:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608638394; cv=none; d=google.com; s=arc-20160816; b=FS1vj3UNKwik75i2+9689SlN/AYUZkBn8Dl1qbEp89uYrcP054YK8og3E4/M+avHbm WQc/tJhgxPLjrbINR8f7b5K2pch/xQAF6FD+m4oPkKQnWEi5drae1xIpAcZQintAhEhI 7HC1MGQrSw3Xad/ubYni6sjcIdvPIIV9zWqiidNHZug+F1uphMMIBvRTc+m3UCODRBeV F9q74cWTFR3D1zzeDuiaqgVwPj+P04CvllN44bKE4rxdCH27ZVoIQr+bKuwmVL/3tq0s QzfatKoCGn3grjJ4ep/L83Il7IoEpymHDKzYe02goFKA5mAJa3zSfz2DbQRe5TTQTnCg yo9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=O5T0MHI4zH25v8yYJyG3dmTvnNN/N7rVIlt8OrJGnYQ=; b=aP04wK65sgX2fPqOLgy35kHzDe6pMoDq3KwgXyKQtc8v8pPzOLjYRtECcRuymkxP8l 8p5IaSthdJIwhSx6i4hwRHyPS4bZ6P9v03uRCrDp8G+DNsMCjU1N3NdyhU4AAMKz5gad NtS/ihrGPOKBJDaQxzv+T/xPPKqA+/VNdAJjKTISSOkiCxWgVnCERt3GptCTjpv1zDQS y89gFye7HF3oeFjSpYmo1LaHizsAlxqQ/pe4RUfVgc9foZjiptM4XZQoiehtOR+oHgkU en9ejXdZVfz1nX/naPtUCGKSs2d4MCKhHXTPdvx1Sia8y+7HnxT+R3LZ7q2LrB5bwguk DbxA== 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 x59si11806563edc.544.2020.12.22.03.59.30; Tue, 22 Dec 2020 03:59:54 -0800 (PST) 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 S1726642AbgLVL4k (ORCPT + 99 others); Tue, 22 Dec 2020 06:56:40 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:10058 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbgLVL4k (ORCPT ); Tue, 22 Dec 2020 06:56:40 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4D0ZX46bZ1zM73H; Tue, 22 Dec 2020 19:55:00 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.498.0; Tue, 22 Dec 2020 19:55:51 +0800 From: Tian Tao To: , , , , , CC: , Subject: [PATCH] drm/hisilicon: Remove drm_dev_put in hibmc Date: Tue, 22 Dec 2020 19:55:56 +0800 Message-ID: <1608638156-7879-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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hibmc use the devm_drm_dev_alloc function in hibmc_pci_probe, if hibmc_pci_probe returns non-zero, devm_drm_dev_alloc will call devm_drm_dev_init, which will call devm_drm_dev_init_release to release drm_dev_put. There is no need for hibmc to call drm_dev_put separately. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index 7159018..0d4e902 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -332,13 +332,13 @@ static int hibmc_pci_probe(struct pci_dev *pdev, ret = pcim_enable_device(pdev); if (ret) { drm_err(dev, "failed to enable pci device: %d\n", ret); - goto err_free; + goto err_return; } ret = hibmc_load(dev); if (ret) { drm_err(dev, "failed to load hibmc: %d\n", ret); - goto err_free; + goto err_return; } ret = drm_dev_register(dev, 0); @@ -354,9 +354,7 @@ static int hibmc_pci_probe(struct pci_dev *pdev, err_unload: hibmc_unload(dev); -err_free: - drm_dev_put(dev); - +err_return: return ret; } -- 2.7.4