platform/x86: wmi: add context argument to the probe function
authorMattias Jacobsson <2pi@mok.nu>
Mon, 27 May 2019 16:21:30 +0000 (18:21 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 17 Jun 2019 12:22:47 +0000 (15:22 +0300)
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>
drivers/platform/x86/dell-smbios-wmi.c
drivers/platform/x86/dell-wmi-descriptor.c
drivers/platform/x86/dell-wmi.c
drivers/platform/x86/huawei-wmi.c
drivers/platform/x86/intel-wmi-thunderbolt.c
drivers/platform/x86/wmi-bmof.c
drivers/platform/x86/wmi.c
include/linux/wmi.h

index c3ed3c8c17b90cdadd55c98c7195703ba0364f01..add2687079f716d078a734b803640bdaa31a9849 100644 (file)
@@ -146,7 +146,7 @@ fail_smbios_cmd:
        return ret;
 }
 
-static int dell_smbios_wmi_probe(struct wmi_device *wdev)
+static int dell_smbios_wmi_probe(struct wmi_device *wdev, const void *context)
 {
        struct wmi_driver *wdriver =
                container_of(wdev->dev.driver, struct wmi_driver, driver);
index 14ab250b7d5a5de70b5863b5808fb83a2b0d47d4..9994fd1a5acf44ec2613bf7e4e310cb1e7e899dd 100644 (file)
@@ -106,7 +106,8 @@ EXPORT_SYMBOL_GPL(dell_wmi_get_hotfix);
  * WMI buffer length        12       4    <length>
  * WMI hotfix number        16       4    <hotfix>
  */
-static int dell_wmi_descriptor_probe(struct wmi_device *wdev)
+static int dell_wmi_descriptor_probe(struct wmi_device *wdev,
+                                    const void *context)
 {
        union acpi_object *obj = NULL;
        struct descriptor_priv *priv;
index d118bb73fcaeb3b3517ed2ce46253d8b2a2028e0..72b0a69a6ed0b698c2a81984eb566207c1537e8d 100644 (file)
@@ -672,7 +672,7 @@ static int dell_wmi_events_set_enabled(bool enable)
        return dell_smbios_error(ret);
 }
 
-static int dell_wmi_probe(struct wmi_device *wdev)
+static int dell_wmi_probe(struct wmi_device *wdev, const void *context)
 {
        struct dell_wmi_priv *priv;
        int ret;
index 52fcac5b393a490685025066e71839f92593d6a3..195a7f3638cb199b7ff8e3ee31142fe9b4e29728 100644 (file)
@@ -166,7 +166,7 @@ static int huawei_wmi_input_setup(struct wmi_device *wdev)
        return input_register_device(priv->idev);
 }
 
-static int huawei_wmi_probe(struct wmi_device *wdev)
+static int huawei_wmi_probe(struct wmi_device *wdev, const void *context)
 {
        struct huawei_wmi_priv *priv;
        int err;
index 4dfa61434a76540f0b842a6ab06dccde2a4b51e5..974c22a7ff61ee4c124f4255bfc053bb892afb0a 100644 (file)
@@ -56,7 +56,8 @@ static const struct attribute_group tbt_attribute_group = {
        .attrs = tbt_attrs,
 };
 
-static int intel_wmi_thunderbolt_probe(struct wmi_device *wdev)
+static int intel_wmi_thunderbolt_probe(struct wmi_device *wdev,
+                                      const void *context)
 {
        int ret;
 
index 8751a13134be931480e9356b98f97c45e9dd561a..105a82b6b076b7338417092d0360e5df9015cebd 100644 (file)
@@ -54,7 +54,7 @@ read_bmof(struct file *filp, struct kobject *kobj,
        return count;
 }
 
-static int wmi_bmof_probe(struct wmi_device *wdev)
+static int wmi_bmof_probe(struct wmi_device *wdev, const void *context)
 {
        struct bmof_priv *priv;
        int ret;
index f3be1c008856f40e84abd571bb150aa964794896..2163fd8bf9e11ec86d5120b042fc11ea88cdf9c7 100644 (file)
@@ -945,7 +945,8 @@ static int wmi_dev_probe(struct device *dev)
                dev_warn(dev, "failed to enable device -- probing anyway\n");
 
        if (wdriver->probe) {
-               ret = wdriver->probe(dev_to_wdev(dev));
+               ret = wdriver->probe(dev_to_wdev(dev),
+                               find_guid_context(wblock, wdriver));
                if (ret != 0)
                        goto probe_failure;
        }
index 592f81afecbbf5dba4c8416d2c99c1206237a009..1e84c474a99339301a71430042b6b6c9e8b41f6c 100644 (file)
@@ -44,7 +44,7 @@ struct wmi_driver {
        struct device_driver driver;
        const struct wmi_device_id *id_table;
 
-       int (*probe)(struct wmi_device *wdev);
+       int (*probe)(struct wmi_device *wdev, const void *context);
        int (*remove)(struct wmi_device *wdev);
        void (*notify)(struct wmi_device *device, union acpi_object *data);
        long (*filter_callback)(struct wmi_device *wdev, unsigned int cmd,