[PATCH] drm: Remove the deprecated drm_put_dev() function

Sui Jingfeng suijingfeng at loongson.cn
Tue Jun 27 14:15:11 UTC 2023


Hi,

On 2023/6/27 16:41, Sui Jingfeng wrote:
> I have verified that
>
> if the ->probe() failed, then the ->remove will be get called.
>
Sorry,

if the ->probe() failed, then the ->remove() will *NOT* get called.


> I'm doing the test by add a line before the drm_dev_alloc()
>
I do the test by adding one line code before the drm_dev_alloc() function

  to generate a fault(error) manually,


>
> See below:
>
> ```
>
>     return -ENODEV;
>
>     dev = drm_dev_alloc(&kms_driver, &pdev->dev);
>     if (IS_ERR(dev))
>         return PTR_ERR(dev);
>
>     ret = pci_enable_device(pdev);
>     if (ret)
>         goto err_free;
> ```
>
>
> So, there is no problem, as far as I can see. 
All in all,  if the ->probe() failed, then the ->remove() will *NOT* get 
called.

-- 
Jingfeng



More information about the dri-devel mailing list