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

platform/x86: wmi: add context argument to the probe function

The struct wmi_device_id has a context pointer field, forward this
pointer as an argument to the probe function in struct wmi_driver.

Update existing users of the same probe function to accept this new
context argument.

Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

authored by

Mattias Jacobsson and committed by
Andy Shevchenko
440c4983 a48e2338

+11 -8
+1 -1
drivers/platform/x86/dell-smbios-wmi.c
··· 146 146 return ret; 147 147 } 148 148 149 - static int dell_smbios_wmi_probe(struct wmi_device *wdev) 149 + static int dell_smbios_wmi_probe(struct wmi_device *wdev, const void *context) 150 150 { 151 151 struct wmi_driver *wdriver = 152 152 container_of(wdev->dev.driver, struct wmi_driver, driver);
+2 -1
drivers/platform/x86/dell-wmi-descriptor.c
··· 106 106 * WMI buffer length 12 4 <length> 107 107 * WMI hotfix number 16 4 <hotfix> 108 108 */ 109 - static int dell_wmi_descriptor_probe(struct wmi_device *wdev) 109 + static int dell_wmi_descriptor_probe(struct wmi_device *wdev, 110 + const void *context) 110 111 { 111 112 union acpi_object *obj = NULL; 112 113 struct descriptor_priv *priv;
+1 -1
drivers/platform/x86/dell-wmi.c
··· 672 672 return dell_smbios_error(ret); 673 673 } 674 674 675 - static int dell_wmi_probe(struct wmi_device *wdev) 675 + static int dell_wmi_probe(struct wmi_device *wdev, const void *context) 676 676 { 677 677 struct dell_wmi_priv *priv; 678 678 int ret;
+1 -1
drivers/platform/x86/huawei-wmi.c
··· 166 166 return input_register_device(priv->idev); 167 167 } 168 168 169 - static int huawei_wmi_probe(struct wmi_device *wdev) 169 + static int huawei_wmi_probe(struct wmi_device *wdev, const void *context) 170 170 { 171 171 struct huawei_wmi_priv *priv; 172 172 int err;
+2 -1
drivers/platform/x86/intel-wmi-thunderbolt.c
··· 56 56 .attrs = tbt_attrs, 57 57 }; 58 58 59 - static int intel_wmi_thunderbolt_probe(struct wmi_device *wdev) 59 + static int intel_wmi_thunderbolt_probe(struct wmi_device *wdev, 60 + const void *context) 60 61 { 61 62 int ret; 62 63
+1 -1
drivers/platform/x86/wmi-bmof.c
··· 54 54 return count; 55 55 } 56 56 57 - static int wmi_bmof_probe(struct wmi_device *wdev) 57 + static int wmi_bmof_probe(struct wmi_device *wdev, const void *context) 58 58 { 59 59 struct bmof_priv *priv; 60 60 int ret;
+2 -1
drivers/platform/x86/wmi.c
··· 945 945 dev_warn(dev, "failed to enable device -- probing anyway\n"); 946 946 947 947 if (wdriver->probe) { 948 - ret = wdriver->probe(dev_to_wdev(dev)); 948 + ret = wdriver->probe(dev_to_wdev(dev), 949 + find_guid_context(wblock, wdriver)); 949 950 if (ret != 0) 950 951 goto probe_failure; 951 952 }
+1 -1
include/linux/wmi.h
··· 44 44 struct device_driver driver; 45 45 const struct wmi_device_id *id_table; 46 46 47 - int (*probe)(struct wmi_device *wdev); 47 + int (*probe)(struct wmi_device *wdev, const void *context); 48 48 int (*remove)(struct wmi_device *wdev); 49 49 void (*notify)(struct wmi_device *device, union acpi_object *data); 50 50 long (*filter_callback)(struct wmi_device *wdev, unsigned int cmd,