Re: [PATCH v3 1/5] drm/rockchip: Add basic drm driver

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

 



On 2014年09月19日 21:04, David Herrmann wrote:
Hi

On Fri, Sep 19, 2014 at 7:47 AM, Mark yao <mark.yao@xxxxxxxxxxxxxx> 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:
OK, I will do it.
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





_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://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