[PATCH 2/2] drm/ast: Call struct drm_driver.{load, unload} before registering device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Both callbacks are deprecated. Remove them and call functions explicitly.

Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx>
---
 drivers/gpu/drm/ast/ast_drv.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
index 78c90a3c903b..9da26750a22d 100644
--- a/drivers/gpu/drm/ast/ast_drv.c
+++ b/drivers/gpu/drm/ast/ast_drv.c
@@ -104,17 +104,24 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	dev->pdev = pdev;
 	pci_set_drvdata(pdev, dev);
 
-	ret = drm_dev_register(dev, ent->driver_data);
+	ret = ast_driver_load(dev, ent->driver_data);
 	if (ret)
 		goto err_drm_dev_put;
 
+	ret = drm_dev_register(dev, ent->driver_data);
+	if (ret)
+		goto err_ast_driver_unload;
+
 	return 0;
 
+err_ast_driver_unload:
+	ast_driver_unload(dev);
 err_drm_dev_put:
 	drm_dev_put(dev);
 err_pci_disable_device:
 	pci_disable_device(pdev);
 	return ret;
+
 }
 
 static void
@@ -123,6 +130,7 @@ ast_pci_remove(struct pci_dev *pdev)
 	struct drm_device *dev = pci_get_drvdata(pdev);
 
 	drm_dev_unregister(dev);
+	ast_driver_unload(dev);
 	drm_dev_put(dev);
 }
 
@@ -228,9 +236,6 @@ static struct drm_driver driver = {
 			   DRIVER_GEM |
 			   DRIVER_MODESET,
 
-	.load = ast_driver_load,
-	.unload = ast_driver_unload,
-
 	.fops = &ast_fops,
 	.name = DRIVER_NAME,
 	.desc = DRIVER_DESC,
-- 
2.23.0

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux