Fix Commit 761fc8a4
While testing live build of powerdevil on Gentoo, I was lost brightness control on my Lenovo Legion 5 15ACH6. After some inspection I found commit 761fc8a4, which was fixing bug 399646. In function BacklightHelper::initUsingBacklightType
on lines 176-177 we are calling functions with one of it's parameters BACKLIGHT_SYSFS_PATH + interface
.
This is leading to an errors inside journalctl like this:
backlighthelper[5849]: org.kde.powerdevil: reading from device "/sys/class/backlight//sys/class/backlight/nvidia_wmi_ec_backlight" / "max_brightness" failed with error code 5 "No such file or directory"
org_kde_powerdevil[5815]: Warning from helper: reading from device "/sys/class/backlight//sys/class/backlight/nvidia_wmi_ec_backlight" / "brightness" failed with error code 5 "No such file or directory"
This is happening because inside function BacklightHelper::getBacklightTypeDevices
while forming lists 'firmware' and 'platform' we appending on lines 137 and 139 BACKLIGHT_SYSFS_PATH + interface
, but for lists 'rawAll' and 'rawEnabled' we append only interface
. And so, if interface is not 'raw' - then we have duplicating BACKLIGHT_SYSFS_PATH inside interface name.
A potential fix would be append to rawAll and rawEnable BACKLIGHT_SYSFS_PATH + interface
and while calling functions on lines 176-177 simply pass interface
.