]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
drm: make sysfs device always available for minors
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 23 Jul 2014 09:38:38 +0000 (11:38 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Tue, 5 Aug 2014 14:08:21 +0000 (16:08 +0200)
commite17280758cc0b4f3d7065554006adcb87448f6c0
tree71641f392c6ab39518ac56b2efa4763e7f5ecdd8
parentf1b8596283f681b82546d6302bc7c372fdb2d422
drm: make sysfs device always available for minors

For each minor we allocate a sysfs device as minor->kdev. Currently, this
is allocated and registered in drm_minor_register(). This makes it
impossible to add sysfs-attributes to the device before it is registered.
Therefore, they are not added atomically, nor can we move device_add()
*after* ->load() is called.

This patch makes minor->kdev available early, but only adds the device
during minor-registration. Note that the registration is still called
before ->load() as debugfs needs to be split, too. This will be fixed in
follow-ups.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
drivers/gpu/drm/drm_stub.c
drivers/gpu/drm/drm_sysfs.c
include/drm/drmP.h