diff options
Diffstat (limited to 'drivers/platform/x86/wmi.c')
-rw-r--r-- | drivers/platform/x86/wmi.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 5ffc00480aef..4fe7650dd014 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -693,15 +693,8 @@ char *wmi_get_acpi_device_uid(const char *guid_string) } EXPORT_SYMBOL_GPL(wmi_get_acpi_device_uid); -static struct wmi_block *dev_to_wblock(struct device *dev) -{ - return container_of(dev, struct wmi_block, dev.dev); -} - -static struct wmi_device *dev_to_wdev(struct device *dev) -{ - return container_of(dev, struct wmi_device, dev); -} +#define dev_to_wblock(__dev) container_of_const(__dev, struct wmi_block, dev.dev) +#define dev_to_wdev(__dev) container_of_const(__dev, struct wmi_device, dev) static inline struct wmi_driver *drv_to_wdrv(struct device_driver *drv) { @@ -804,9 +797,9 @@ static struct attribute *wmi_method_attrs[] = { }; ATTRIBUTE_GROUPS(wmi_method); -static int wmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env) +static int wmi_dev_uevent(const struct device *dev, struct kobj_uevent_env *env) { - struct wmi_block *wblock = dev_to_wblock(dev); + const struct wmi_block *wblock = dev_to_wblock(dev); if (add_uevent_var(env, "MODALIAS=wmi:%pUL", &wblock->gblock.guid)) return -ENOMEM; |