drm/i915/backlight: use unique backlight device names
authorJani Nikula <jani.nikula@intel.com>
Wed, 28 Apr 2021 10:14:29 +0000 (13:14 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 3 May 2021 13:41:41 +0000 (16:41 +0300)
commit20f85ef89d94e12041bc9b0a335a0e7d6c61daf7
tree9e1afe2b17db6142f7c9b40bb1e9b6dafd978e1b
parentb08a759df332c4152ef75c7e011195c04abfac04
drm/i915/backlight: use unique backlight device names

Registering multiple backlight devices with intel_backlight name will
obviously fail, regardless of whether they're two connectors in the same
drm device or two different drm devices.

It would be preferrable to switch to completely unique names, and sunset
the generic intel_backlight name. However, there are apparently users
out there that hardcode the name, so the change would break backward
compatibility.

As a compromise, register the first device with intel_backlight name. In
the common case, this is the only backlight device anyway. From the
second device on, use card%d-%s-backlight format, for example
card0-eDP-2-backlight, to make the name unique.

This approach does not preclude us from registering the first device
using the same naming scheme in the future.

v2: Keep using intel_backlight name for first backlight device

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2794
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/7dc3f6974711ce44522189dc9db05d1e6e24e6d8.1619604743.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_panel.c