platform/x86: thinkpad_acpi: Fix the hwmon sysfs-attr showing up in the wrong place
authorHans de Goede <hdegoede@redhat.com>
Tue, 23 Nov 2021 21:04:22 +0000 (22:04 +0100)
committerHans de Goede <hdegoede@redhat.com>
Thu, 25 Nov 2021 15:22:50 +0000 (16:22 +0100)
commit526ac103dbc67291a071fc57aab0f85ad7298ef3
treeb9e7f741a4f58dafd46c6205f80f9982f38968b3
parent5cd689683eb0507c67f825f1c29b17bb80612468
platform/x86: thinkpad_acpi: Fix the hwmon sysfs-attr showing up in the wrong place

The hwmon sysfs-attr should show up under the hwmon-classdev, not under
the tpacpi_sensors_pdev. Pass the tpacpi_hwmon_groups attr-groups array
to hwmon_device_register_with_groups() instead of setting
tpacpi_hwmon_pdriver.driver.dev_groups to it to fix this.

This also requires moving the hwmon_device_register_with_groups() call to
after the subdriver init functions have run so that the is_visible()
calls will work properly.

Fixes: 79f960e29cfc ("platform/x86: thinkpad_acpi: Convert platform driver to use dev_groups")
Cc: Len Baker <len.baker@gmx.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20211123210424.266607-5-hdegoede@redhat.com
drivers/platform/x86/thinkpad_acpi.c