* Re: [PATCH] drm: Drop unused drm_device_class_(un)register API
2026-04-29 8:57 [PATCH] drm: Drop unused drm_device_class_(un)register API Tvrtko Ursulin
@ 2026-04-29 9:35 ` Thomas Zimmermann
2026-04-29 10:45 ` Tvrtko Ursulin
2026-04-29 12:15 ` Christian König
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Thomas Zimmermann @ 2026-04-29 9:35 UTC (permalink / raw)
To: Tvrtko Ursulin, dri-devel
Cc: kernel-dev, Christian König, Maarten Lankhorst,
Maxime Ripard, David Airlie, Simona Vetter
Hi
Am 29.04.26 um 10:57 schrieb Tvrtko Ursulin:
> The API has been unused since commit
> ed89fff97382 ("drm/ttm: drop sysfs directory")
> so lets remove it.
drm_privacy_screen_register() uses the same pattern. [1] If that helper
is being converted over to drm_class_device_register(), the global
drm_class could be internalized into drm_sysfb.c. Personally, I think
this is the better solution, but either seems fine. [1]
https://elixir.bootlin.com/linux/v7.0.1/source/drivers/gpu/drm/drm_privacy_screen.c#L405
Best regards
Thomas
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Simona Vetter <simona@ffwll.ch>
> ---
> drivers/gpu/drm/drm_sysfs.c | 32 --------------------------------
> include/drm/drm_sysfs.h | 4 ----
> 2 files changed, 36 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
> index 43b2c3eaa7e4..7433bf8136cc 100644
> --- a/drivers/gpu/drm/drm_sysfs.c
> +++ b/drivers/gpu/drm/drm_sysfs.c
> @@ -645,35 +645,3 @@ struct device *drm_sysfs_minor_alloc(struct drm_minor *minor)
> put_device(kdev);
> return ERR_PTR(r);
> }
> -
> -/**
> - * drm_class_device_register - register new device with the DRM sysfs class
> - * @dev: device to register
> - *
> - * Registers a new &struct device within the DRM sysfs class. Essentially only
> - * used by ttm to have a place for its global settings. Drivers should never use
> - * this.
> - */
> -int drm_class_device_register(struct device *dev)
> -{
> - if (!drm_class || IS_ERR(drm_class))
> - return -ENOENT;
> -
> - dev->class = drm_class;
> - return device_register(dev);
> -}
> -EXPORT_SYMBOL_GPL(drm_class_device_register);
> -
> -/**
> - * drm_class_device_unregister - unregister device with the DRM sysfs class
> - * @dev: device to unregister
> - *
> - * Unregisters a &struct device from the DRM sysfs class. Essentially only used
> - * by ttm to have a place for its global settings. Drivers should never use
> - * this.
> - */
> -void drm_class_device_unregister(struct device *dev)
> -{
> - return device_unregister(dev);
> -}
> -EXPORT_SYMBOL_GPL(drm_class_device_unregister);
> diff --git a/include/drm/drm_sysfs.h b/include/drm/drm_sysfs.h
> index 96a5d858404b..7695873a9456 100644
> --- a/include/drm/drm_sysfs.h
> +++ b/include/drm/drm_sysfs.h
> @@ -3,13 +3,9 @@
> #define _DRM_SYSFS_H_
>
> struct drm_device;
> -struct device;
> struct drm_connector;
> struct drm_property;
>
> -int drm_class_device_register(struct device *dev);
> -void drm_class_device_unregister(struct device *dev);
> -
> void drm_sysfs_hotplug_event(struct drm_device *dev);
> void drm_sysfs_connector_hotplug_event(struct drm_connector *connector);
> void drm_sysfs_connector_property_event(struct drm_connector *connector,
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] drm: Drop unused drm_device_class_(un)register API
2026-04-29 9:35 ` Thomas Zimmermann
@ 2026-04-29 10:45 ` Tvrtko Ursulin
0 siblings, 0 replies; 6+ messages in thread
From: Tvrtko Ursulin @ 2026-04-29 10:45 UTC (permalink / raw)
To: Thomas Zimmermann, dri-devel, Hans de Goede
Cc: kernel-dev, Christian König, Maarten Lankhorst,
Maxime Ripard, David Airlie, Simona Vetter
On 29/04/2026 10:35, Thomas Zimmermann wrote:
> Hi
>
> Am 29.04.26 um 10:57 schrieb Tvrtko Ursulin:
>> The API has been unused since commit
>> ed89fff97382 ("drm/ttm: drop sysfs directory")
>> so lets remove it.
>
> drm_privacy_screen_register() uses the same pattern. [1] If that helper
> is being converted over to drm_class_device_register(), the global
> drm_class could be internalized into drm_sysfb.c. Personally, I think
> this is the better solution, but either seems fine. [1] https://
> elixir.bootlin.com/linux/v7.0.1/source/drivers/gpu/drm/
> drm_privacy_screen.c#L405
I did not spot that one. The alternative sounds reasonable to me. Adding
Hans to check if he wants to take over converting this driver.
Regards,
Tvrtko
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
>> Cc: Christian König <christian.koenig@amd.com>
>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Cc: Maxime Ripard <mripard@kernel.org>
>> Cc: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: David Airlie <airlied@gmail.com>
>> Cc: Simona Vetter <simona@ffwll.ch>
>> ---
>> drivers/gpu/drm/drm_sysfs.c | 32 --------------------------------
>> include/drm/drm_sysfs.h | 4 ----
>> 2 files changed, 36 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
>> index 43b2c3eaa7e4..7433bf8136cc 100644
>> --- a/drivers/gpu/drm/drm_sysfs.c
>> +++ b/drivers/gpu/drm/drm_sysfs.c
>> @@ -645,35 +645,3 @@ struct device *drm_sysfs_minor_alloc(struct
>> drm_minor *minor)
>> put_device(kdev);
>> return ERR_PTR(r);
>> }
>> -
>> -/**
>> - * drm_class_device_register - register new device with the DRM sysfs
>> class
>> - * @dev: device to register
>> - *
>> - * Registers a new &struct device within the DRM sysfs class.
>> Essentially only
>> - * used by ttm to have a place for its global settings. Drivers
>> should never use
>> - * this.
>> - */
>> -int drm_class_device_register(struct device *dev)
>> -{
>> - if (!drm_class || IS_ERR(drm_class))
>> - return -ENOENT;
>> -
>> - dev->class = drm_class;
>> - return device_register(dev);
>> -}
>> -EXPORT_SYMBOL_GPL(drm_class_device_register);
>> -
>> -/**
>> - * drm_class_device_unregister - unregister device with the DRM sysfs
>> class
>> - * @dev: device to unregister
>> - *
>> - * Unregisters a &struct device from the DRM sysfs class. Essentially
>> only used
>> - * by ttm to have a place for its global settings. Drivers should
>> never use
>> - * this.
>> - */
>> -void drm_class_device_unregister(struct device *dev)
>> -{
>> - return device_unregister(dev);
>> -}
>> -EXPORT_SYMBOL_GPL(drm_class_device_unregister);
>> diff --git a/include/drm/drm_sysfs.h b/include/drm/drm_sysfs.h
>> index 96a5d858404b..7695873a9456 100644
>> --- a/include/drm/drm_sysfs.h
>> +++ b/include/drm/drm_sysfs.h
>> @@ -3,13 +3,9 @@
>> #define _DRM_SYSFS_H_
>> struct drm_device;
>> -struct device;
>> struct drm_connector;
>> struct drm_property;
>> -int drm_class_device_register(struct device *dev);
>> -void drm_class_device_unregister(struct device *dev);
>> -
>> void drm_sysfs_hotplug_event(struct drm_device *dev);
>> void drm_sysfs_connector_hotplug_event(struct drm_connector
>> *connector);
>> void drm_sysfs_connector_property_event(struct drm_connector
>> *connector,
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm: Drop unused drm_device_class_(un)register API
2026-04-29 8:57 [PATCH] drm: Drop unused drm_device_class_(un)register API Tvrtko Ursulin
2026-04-29 9:35 ` Thomas Zimmermann
@ 2026-04-29 12:15 ` Christian König
2026-05-05 1:46 ` Claude review: " Claude Code Review Bot
2026-05-05 1:46 ` Claude Code Review Bot
3 siblings, 0 replies; 6+ messages in thread
From: Christian König @ 2026-04-29 12:15 UTC (permalink / raw)
To: Tvrtko Ursulin, dri-devel
Cc: kernel-dev, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter
On 4/29/26 10:57, Tvrtko Ursulin wrote:
> The API has been unused since commit
> ed89fff97382 ("drm/ttm: drop sysfs directory")
> so lets remove it.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Simona Vetter <simona@ffwll.ch>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/drm_sysfs.c | 32 --------------------------------
> include/drm/drm_sysfs.h | 4 ----
> 2 files changed, 36 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
> index 43b2c3eaa7e4..7433bf8136cc 100644
> --- a/drivers/gpu/drm/drm_sysfs.c
> +++ b/drivers/gpu/drm/drm_sysfs.c
> @@ -645,35 +645,3 @@ struct device *drm_sysfs_minor_alloc(struct drm_minor *minor)
> put_device(kdev);
> return ERR_PTR(r);
> }
> -
> -/**
> - * drm_class_device_register - register new device with the DRM sysfs class
> - * @dev: device to register
> - *
> - * Registers a new &struct device within the DRM sysfs class. Essentially only
> - * used by ttm to have a place for its global settings. Drivers should never use
> - * this.
> - */
> -int drm_class_device_register(struct device *dev)
> -{
> - if (!drm_class || IS_ERR(drm_class))
> - return -ENOENT;
> -
> - dev->class = drm_class;
> - return device_register(dev);
> -}
> -EXPORT_SYMBOL_GPL(drm_class_device_register);
> -
> -/**
> - * drm_class_device_unregister - unregister device with the DRM sysfs class
> - * @dev: device to unregister
> - *
> - * Unregisters a &struct device from the DRM sysfs class. Essentially only used
> - * by ttm to have a place for its global settings. Drivers should never use
> - * this.
> - */
> -void drm_class_device_unregister(struct device *dev)
> -{
> - return device_unregister(dev);
> -}
> -EXPORT_SYMBOL_GPL(drm_class_device_unregister);
> diff --git a/include/drm/drm_sysfs.h b/include/drm/drm_sysfs.h
> index 96a5d858404b..7695873a9456 100644
> --- a/include/drm/drm_sysfs.h
> +++ b/include/drm/drm_sysfs.h
> @@ -3,13 +3,9 @@
> #define _DRM_SYSFS_H_
>
> struct drm_device;
> -struct device;
> struct drm_connector;
> struct drm_property;
>
> -int drm_class_device_register(struct device *dev);
> -void drm_class_device_unregister(struct device *dev);
> -
> void drm_sysfs_hotplug_event(struct drm_device *dev);
> void drm_sysfs_connector_hotplug_event(struct drm_connector *connector);
> void drm_sysfs_connector_property_event(struct drm_connector *connector,
^ permalink raw reply [flat|nested] 6+ messages in thread* Claude review: drm: Drop unused drm_device_class_(un)register API
2026-04-29 8:57 [PATCH] drm: Drop unused drm_device_class_(un)register API Tvrtko Ursulin
2026-04-29 9:35 ` Thomas Zimmermann
2026-04-29 12:15 ` Christian König
@ 2026-05-05 1:46 ` Claude Code Review Bot
2026-05-05 1:46 ` Claude Code Review Bot
3 siblings, 0 replies; 6+ messages in thread
From: Claude Code Review Bot @ 2026-05-05 1:46 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Correctness: Good.**
- The removal of `drm_class_device_register()` and `drm_class_device_unregister()` from `drm_sysfs.c` is complete — both function bodies and their `EXPORT_SYMBOL_GPL` lines are removed.
- The header `drm_sysfs.h` correctly removes both function declarations and the `struct device` forward declaration, which was only needed for those function prototypes.
- The remaining declarations in `drm_sysfs.h` (`drm_sysfs_hotplug_event`, `drm_sysfs_connector_hotplug_event`, `drm_sysfs_connector_property_event`) use `struct drm_device`, `struct drm_connector`, and `struct drm_property` — none require `struct device`, so removing that forward declaration is safe.
**Nit (commit message):** The subject says `drm_device_class_(un)register` but the actual function names are `drm_class_device_register` / `drm_class_device_unregister` — the word order is swapped. This is a minor cosmetic issue in the subject line:
```
Subject: [PATCH] drm: Drop unused drm_device_class_(un)register API
```
Should be:
```
Subject: [PATCH] drm: Drop unused drm_class_device_(un)register API
```
**No other issues.** The patch is minimal, correct, and safe to merge (with optionally fixing the subject typo).
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 6+ messages in thread
* Claude review: drm: Drop unused drm_device_class_(un)register API
2026-04-29 8:57 [PATCH] drm: Drop unused drm_device_class_(un)register API Tvrtko Ursulin
` (2 preceding siblings ...)
2026-05-05 1:46 ` Claude review: " Claude Code Review Bot
@ 2026-05-05 1:46 ` Claude Code Review Bot
3 siblings, 0 replies; 6+ messages in thread
From: Claude Code Review Bot @ 2026-05-05 1:46 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: drm: Drop unused drm_device_class_(un)register API
Author: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Patches: 4
Reviewed: 2026-05-05T11:46:02.517455
---
This is a single, straightforward cleanup patch that removes dead code. The `drm_class_device_register()` and `drm_class_device_unregister()` functions have had no callers since TTM dropped its sysfs directory (commit `ed89fff97382`). The patch correctly removes both the implementations in `drm_sysfs.c` and the declarations plus the now-unneeded `struct device` forward declaration in `drm_sysfs.h`. A grep of the kernel tree confirms there are zero remaining callers.
**Verdict: Looks good.** This is a clean, no-risk removal of unused exported symbols.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 6+ messages in thread