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 <[email protected]>
---
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
On Tue, Dec 22, 2020 at 12:56 PM Tian Tao <[email protected]> wrote:
>
> 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 <[email protected]>
lgtm, Reviewed-by: Daniel Vetter <[email protected]>
Cheers, Daniel
> ---
> 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
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch