On Sun, Sep 08, 2024 at 02:08:58PM GMT, Heiner Kallweit wrote:
> This undocumented attribute returns a version string which hasn't been
> changed for ages. libdrm doesn't use it and I also found no other user.
> So I think we can remove it.

This file is a part of the ABI. Commit 82d5e73f6b79 ("drm: drop obsolete
drm_core.h") replaced variable string with the fixed value that we
currently have, but at the same it clearly documented that the file is
being preserved for the sake of binary compatibility.

> 
> Signed-off-by: Heiner Kallweit <[email protected]>
> ---
>  drivers/gpu/drm/drm_sysfs.c | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
> index fb3bbb6ad..49e5faf11 100644
> --- a/drivers/gpu/drm/drm_sysfs.c
> +++ b/drivers/gpu/drm/drm_sysfs.c
> @@ -126,8 +126,6 @@ static const struct component_ops typec_connector_ops = {
>       .unbind = typec_connector_unbind,
>  };
>  
> -static CLASS_ATTR_STRING(version, S_IRUGO, "drm 1.1.0 20060810");
> -
>  /**
>   * drm_sysfs_init - initialize sysfs helpers
>   *
> @@ -140,19 +138,10 @@ static CLASS_ATTR_STRING(version, S_IRUGO, "drm 1.1.0 
> 20060810");
>   */
>  int drm_sysfs_init(void)
>  {
> -     int err;
> -
>       drm_class = class_create("drm");
>       if (IS_ERR(drm_class))
>               return PTR_ERR(drm_class);
>  
> -     err = class_create_file(drm_class, &class_attr_version.attr);
> -     if (err) {
> -             class_destroy(drm_class);
> -             drm_class = NULL;
> -             return err;
> -     }
> -
>       drm_class->devnode = drm_devnode;
>  
>       drm_sysfs_acpi_register();
> @@ -169,7 +158,6 @@ void drm_sysfs_destroy(void)
>       if (IS_ERR_OR_NULL(drm_class))
>               return;
>       drm_sysfs_acpi_unregister();
> -     class_remove_file(drm_class, &class_attr_version.attr);
>       class_destroy(drm_class);
>       drm_class = NULL;
>  }
> -- 
> 2.46.0
> 
> 

-- 
With best wishes
Dmitry

Reply via email to