return 0;
}
-static int ade_drm_init(struct platform_device *pdev)
+static int ade_drm_init(struct drm_device *dev)
{
- struct drm_device *drm_dev = platform_get_drvdata(dev);
+ struct platform_device *pdev = dev->platformdev;
struct ade_data *ade;
struct ade_hw_ctx *ctx;
struct ade_crtc *acrtc;
return 0;
}
-static void ade_drm_cleanup(struct platform_device *pdev)
+static void ade_drm_cleanup(struct drm_device *dev)
{
- struct drm_device *drm_dev = platform_get_drvdata(dev);
+ struct platform_device *pdev = dev->platformdev;
struct ade_data *ade = platform_get_drvdata(pdev);
struct drm_crtc *crtc = &ade->acrtc.base;
const struct kirin_dc_ops ade_dc_ops = {
.init = ade_drm_init,
.cleanup = ade_drm_cleanup
-;
+};
#endif
drm_kms_helper_poll_fini(dev);
drm_vblank_cleanup(dev);
- dc_ops->cleanup(to_platform_device(dev->dev));
+ dc_ops->cleanup(dev);
drm_mode_config_cleanup(dev);
devm_kfree(dev->dev, priv);
dev->dev_private = NULL;
kirin_drm_mode_config_init(dev);
/* display controller init */
- ret = dc_ops->init(to_platform_device(dev));
+ ret = dc_ops->init(dev);
if (ret)
goto err_mode_config_cleanup;
if (!drm_dev)
return -ENOMEM;
+ drm_dev->platformdev = to_platform_device(dev);
+
ret = kirin_drm_kms_init(drm_dev);
if (ret)
goto err_drm_dev_unref;
/* display controller init/cleanup ops */
struct kirin_dc_ops {
- int (*init)(struct platform_device *pdev);
- void (*cleanup)(struct platform_device *pdev);
+ int (*init)(struct drm_device *dev);
+ void (*cleanup)(struct drm_device *dev);
};
struct kirin_drm_private {