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>
This commit is contained in:
Родитель
b37fe34c83
Коммит
4e3d731ba7
|
@ -51,26 +51,7 @@ static struct attribute *tbt_attrs[] = {
|
||||||
&dev_attr_force_power.attr,
|
&dev_attr_force_power.attr,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
ATTRIBUTE_GROUPS(tbt);
|
||||||
static const struct attribute_group tbt_attribute_group = {
|
|
||||||
.attrs = tbt_attrs,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int intel_wmi_thunderbolt_probe(struct wmi_device *wdev,
|
|
||||||
const void *context)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = sysfs_create_group(&wdev->dev.kobj, &tbt_attribute_group);
|
|
||||||
kobject_uevent(&wdev->dev.kobj, KOBJ_CHANGE);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void intel_wmi_thunderbolt_remove(struct wmi_device *wdev)
|
|
||||||
{
|
|
||||||
sysfs_remove_group(&wdev->dev.kobj, &tbt_attribute_group);
|
|
||||||
kobject_uevent(&wdev->dev.kobj, KOBJ_CHANGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct wmi_device_id intel_wmi_thunderbolt_id_table[] = {
|
static const struct wmi_device_id intel_wmi_thunderbolt_id_table[] = {
|
||||||
{ .guid_string = INTEL_WMI_THUNDERBOLT_GUID },
|
{ .guid_string = INTEL_WMI_THUNDERBOLT_GUID },
|
||||||
|
@ -80,9 +61,8 @@ static const struct wmi_device_id intel_wmi_thunderbolt_id_table[] = {
|
||||||
static struct wmi_driver intel_wmi_thunderbolt_driver = {
|
static struct wmi_driver intel_wmi_thunderbolt_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "intel-wmi-thunderbolt",
|
.name = "intel-wmi-thunderbolt",
|
||||||
|
.dev_groups = tbt_groups,
|
||||||
},
|
},
|
||||||
.probe = intel_wmi_thunderbolt_probe,
|
|
||||||
.remove = intel_wmi_thunderbolt_remove,
|
|
||||||
.id_table = intel_wmi_thunderbolt_id_table,
|
.id_table = intel_wmi_thunderbolt_id_table,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче