Commit 79f960e29cfc ("platform/x86: thinkpad_acpi: Convert platform driver to use dev_groups") put the debug_level, interface_version, version and the THINKPAD_ACPI_DEBUGFACILITIES attributes in a new tpacpi_attr_group and added those to the tpacpi_groups groups-array which is used to initialize the driver.dev_groups member. But before this commit these attributes were registered with driver_create_file(), so they should be part of the groups-array which is used to initialize the driver.groups member instead. And also make the same change for the fan_watchdog hwmon driver attribute. Fixes: 79f960e29cfc ("platform/x86: thinkpad_acpi: Convert platform driver to use dev_groups") Cc: Len Baker <len.baker@xxxxxxx> Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx> --- drivers/platform/x86/thinkpad_acpi.c | 30 +++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index ecec5351daed..7680bb0ee2d5 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -8646,7 +8646,6 @@ static struct attribute *fan_attributes[] = { &dev_attr_pwm1.attr, &dev_attr_fan1_input.attr, &dev_attr_fan2_input.attr, - &driver_attr_fan_watchdog.attr, NULL }; @@ -8670,6 +8669,16 @@ static const struct attribute_group fan_attr_group = { .attrs = fan_attributes, }; +static struct attribute *fan_driver_attributes[] = { + &driver_attr_fan_watchdog.attr, + NULL +}; + +static const struct attribute_group fan_driver_attr_group = { + .is_visible = fan_attr_is_visible, + .attrs = fan_driver_attributes, +}; + #define TPACPI_FAN_Q1 0x0001 /* Unitialized HFSP */ #define TPACPI_FAN_2FAN 0x0002 /* EC 0x31 bit 0 selects fan2 */ #define TPACPI_FAN_2CTL 0x0004 /* selects fan2 control */ @@ -10435,7 +10444,7 @@ static struct ibm_struct dprc_driver_data = { /* --------------------------------------------------------------------- */ -static struct attribute *tpacpi_attributes[] = { +static struct attribute *tpacpi_driver_attributes[] = { &driver_attr_debug_level.attr, &driver_attr_version.attr, &driver_attr_interface_version.attr, @@ -10470,11 +10479,16 @@ static umode_t tpacpi_attr_is_visible(struct kobject *kobj, } #endif -static const struct attribute_group tpacpi_attr_group = { +static const struct attribute_group tpacpi_driver_attr_group = { #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES .is_visible = tpacpi_attr_is_visible, #endif - .attrs = tpacpi_attributes, + .attrs = tpacpi_driver_attributes, +}; + +static const struct attribute_group *tpacpi_driver_groups[] = { + &tpacpi_driver_attr_group, + NULL, }; static const struct attribute_group *tpacpi_groups[] = { @@ -10486,7 +10500,6 @@ static const struct attribute_group *tpacpi_groups[] = { &proxsensor_attr_group, &kbdlang_attr_group, &dprc_attr_group, - &tpacpi_attr_group, NULL, }; @@ -10497,6 +10510,11 @@ static const struct attribute_group *tpacpi_hwmon_groups[] = { NULL, }; +static const struct attribute_group *tpacpi_hwmon_driver_groups[] = { + &fan_driver_attr_group, + NULL, +}; + /**************************************************************************** **************************************************************************** * @@ -10509,6 +10527,7 @@ static struct platform_driver tpacpi_pdriver = { .driver = { .name = TPACPI_DRVR_NAME, .pm = &tpacpi_pm, + .groups = tpacpi_driver_groups, .dev_groups = tpacpi_groups, }, .shutdown = tpacpi_shutdown_handler, @@ -10517,6 +10536,7 @@ static struct platform_driver tpacpi_pdriver = { static struct platform_driver tpacpi_hwmon_pdriver = { .driver = { .name = TPACPI_HWMON_DRVR_NAME, + .groups = tpacpi_hwmon_driver_groups, .dev_groups = tpacpi_hwmon_groups, }, }; -- 2.33.1