diff mbox

[2/3] drm/hisilicon: Make kirin_drm_unbind sufficient

Message ID 1462761128-106487-3-git-send-email-xinliang.liu@linaro.org
State Accepted
Commit 12cb4c87aa587ff476ffc71120f2dc5d2e857256
Headers show

Commit Message

Xinliang Liu May 9, 2016, 2:32 a.m. UTC
Remove deprecated drm_put_dev.
Clean up everything needed in unbind.
Thanks to Daniel Vetter, this issue is reported by him.

Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Reported-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Xinliang Liu May 10, 2016, 2:24 a.m. UTC | #1
On 9 May 2016 at 14:44, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Mon, May 09, 2016 at 10:32:07AM +0800, Xinliang Liu wrote:
>> Remove deprecated drm_put_dev.
>> Clean up everything needed in unbind.
>> Thanks to Daniel Vetter, this issue is reported by him.
>>
>> Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
>> Reported-by: Daniel Vetter <daniel.vetter@intel.com>
>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Thanks, Daniel.
-xinliang

>> ---
>>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
>> index bc410ee584b7..3f94785fbcca 100644
>> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
>> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
>> @@ -244,7 +244,12 @@ err_drm_dev_unref:
>>
>>  static void kirin_drm_unbind(struct device *dev)
>>  {
>> -     drm_put_dev(dev_get_drvdata(dev));
>> +     struct drm_device *drm_dev = dev_get_drvdata(dev);
>> +
>> +     drm_connector_unregister_all(drm_dev);
>> +     drm_dev_unregister(drm_dev);
>> +     kirin_drm_kms_cleanup(drm_dev);
>> +     drm_dev_unref(drm_dev);
>>  }
>>
>>  static const struct component_master_ops kirin_drm_ops = {
>> --
>> 2.8.2
>>
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
diff mbox

Patch

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index bc410ee584b7..3f94785fbcca 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -244,7 +244,12 @@  err_drm_dev_unref:
 
 static void kirin_drm_unbind(struct device *dev)
 {
-	drm_put_dev(dev_get_drvdata(dev));
+	struct drm_device *drm_dev = dev_get_drvdata(dev);
+
+	drm_connector_unregister_all(drm_dev);
+	drm_dev_unregister(drm_dev);
+	kirin_drm_kms_cleanup(drm_dev);
+	drm_dev_unref(drm_dev);
 }
 
 static const struct component_master_ops kirin_drm_ops = {