Re: fixing up DRM device model usage

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Kay Sievers
Date: Friday, October 26, 2007 - 12:08 pm

On Fri, 2007-10-26 at 11:40 -0700, Jesse Barnes wrote:

Seems fine, at a first look. You moved the device structure into the
object where it belongs, instead of allocating one, and saving the
pointer. You should really considering changing the core to do the
free()ing of your object with the embedded devices release function,
that is called when the last reference to the object is gone, instead of
"hoping the best". :) But if the drm core does that properly, it might
work, sure.

The open coded: device_create_file(&dev->dev, &device_attrs[i]) should
probably replaced by passing the array to the class, and the core will
do that for you. 

Do you assign the dev_t: MKDEV(DRM_MAJOR, head->minor) somewhere? You
need to put it in dev->devt, if you want a device node created by
userspace.


You should use the same value as the old code:
  &(head->dev->pdev)->dev
and assign it as the parent, seems right..


Keep it, you want to express the relationship in sysfs, so that a
"device" link is created, or that the device directory lives as a child
below the parent device. Seems fine so far.


Hehe, that's always a solution. :)

Kay

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] full suspend/resume support for i915 DRM driver, Jesse Barnes, (Thu Oct 18, 2:01 pm)
Re: [RFC] full suspend/resume support for i915 DRM driver, Rafael J. Wysocki, (Wed Oct 24, 2:22 pm)
Re: [RFC] full suspend/resume support for i915 DRM driver, Jesse Barnes, (Fri Oct 26, 11:12 am)
Re: fixing up DRM device model usage, Jesse Barnes, (Fri Oct 26, 11:40 am)
Re: fixing up DRM device model usage, Kay Sievers, (Fri Oct 26, 12:08 pm)
Re: fixing up DRM device model usage, Jesse Barnes, (Fri Oct 26, 2:31 pm)
Re: fixing up DRM device model usage, Kay Sievers, (Sat Oct 27, 2:12 pm)