[PATCH v3 1/5] drm/rockchip: Add basic drm driver
David Herrmann
dh.herrmann at gmail.com
Fri Sep 19 06:04:34 PDT 2014
Hi
On Fri, Sep 19, 2014 at 7:47 AM, Mark yao <mark.yao at rock-chips.com> wrote:
[snip]
> +static int rockchip_drm_bind(struct device *dev)
> +{
> + return drm_platform_init(&rockchip_drm_driver, to_platform_device(dev));
Please avoid drm_platform_*() usage. We're about to drop all the
drm_bus midlayers. See the tegra driver how to do it, but basically
just this:
struct drm_device *ddev;
ddev = drm_dev_alloc(&rockchip_drm_driver, &to_platform_device(dev)->dev);
if (!ddev)
return -ENOMEM;
r = drm_dev_set_unique(ddev, dev_name(&ddev->dev));
if (r < 0) {
drm_dev_unref(ddev);
return r;
}
r = drm_dev_register(ddev);
if (r < 0) {
drm_dev_unref(ddev);
return r;
}
> +}
> +
> +static void rockchip_drm_unbind(struct device *dev)
> +{
> + drm_put_dev(dev_get_drvdata(dev));
Please use:
struct drm_device *ddev = dev_get_drvdata(dev);
drm_dev_unregister(ddev);
drm_dev_unref(ddev);
Thanks
David
More information about the Linux-rockchip
mailing list