Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/x86/intel/wmi: thunderbolt: Use dev_groups callback

Use .dev_groups callback instead of manual sysfs registration.
Remove .probe and .remove callbacks as they become dummy after
using .dev_groups.

Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20220927135612.1602491-1-Shyam-sundar.S-k@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Shyam Sundar S K and committed by
Hans de Goede
4e3d731b b37fe34c

+2 -22
+2 -22
drivers/platform/x86/intel/wmi/thunderbolt.c
··· 51 51 &dev_attr_force_power.attr, 52 52 NULL 53 53 }; 54 - 55 - static const struct attribute_group tbt_attribute_group = { 56 - .attrs = tbt_attrs, 57 - }; 58 - 59 - static int intel_wmi_thunderbolt_probe(struct wmi_device *wdev, 60 - const void *context) 61 - { 62 - int ret; 63 - 64 - ret = sysfs_create_group(&wdev->dev.kobj, &tbt_attribute_group); 65 - kobject_uevent(&wdev->dev.kobj, KOBJ_CHANGE); 66 - return ret; 67 - } 68 - 69 - static void intel_wmi_thunderbolt_remove(struct wmi_device *wdev) 70 - { 71 - sysfs_remove_group(&wdev->dev.kobj, &tbt_attribute_group); 72 - kobject_uevent(&wdev->dev.kobj, KOBJ_CHANGE); 73 - } 54 + ATTRIBUTE_GROUPS(tbt); 74 55 75 56 static const struct wmi_device_id intel_wmi_thunderbolt_id_table[] = { 76 57 { .guid_string = INTEL_WMI_THUNDERBOLT_GUID }, ··· 61 80 static struct wmi_driver intel_wmi_thunderbolt_driver = { 62 81 .driver = { 63 82 .name = "intel-wmi-thunderbolt", 83 + .dev_groups = tbt_groups, 64 84 }, 65 - .probe = intel_wmi_thunderbolt_probe, 66 - .remove = intel_wmi_thunderbolt_remove, 67 85 .id_table = intel_wmi_thunderbolt_id_table, 68 86 }; 69 87