Merge tag 'acpi-6.5-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 7 Jul 2023 05:25:06 +0000 (22:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 7 Jul 2023 05:25:06 +0000 (22:25 -0700)
Pull more ACPI updates from Rafael Wysocki:
 "These fix a couple of compiler warnings, refine an ACPI device
  enumeration quirk to address a driver regression and clean up code.

  Specifics:

   - Make acpi_companion_match() return a const pointer and update its
     callers accordingly (Andy Shevchenko)

   - Move the extern declaration of the acpi_root variable to a header
     file so as to address a compiler warning (Andy Shevchenko)

   - Address compiler warnings in the ACPI device enumeration code by
     adding a missing header file include to it (Ben Dooks)

   - Refine the SMB0001 quirk in the ACPI device enumeration code so as
     to address an i2c-scmi driver regression (Andy Shevchenko)

   - Clean up two pieces of the ACPI device enumeration code (Andy
     Shevchenko)"

* tag 'acpi-6.5-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: scan: Use the acpi_match_acpi_device() helper
  ACPI: platform: Move SMB0001 HID to the header and reuse
  ACPI: platform: Ignore SMB0001 only when it has resources
  ACPI: bus: Introduce acpi_match_acpi_device() helper
  ACPI: scan: fix undeclared variable warnings by including sleep.h
  ACPI: bus: Constify acpi_companion_match() returned value
  ACPI: scan: Move acpi_root to internal header

1  2 
drivers/i2c/busses/i2c-scmi.c
include/linux/acpi.h

@@@ -13,9 -13,6 +13,6 @@@
  #include <linux/i2c.h>
  #include <linux/acpi.h>
  
- /* SMBUS HID definition as supported by Microsoft Windows */
- #define ACPI_SMBUS_MS_HID             "SMB0001"
  struct smbus_methods_t {
        char *mt_info;
        char *mt_sbr;
@@@ -404,17 -401,19 +401,17 @@@ err
        return ret;
  }
  
 -static int smbus_cmi_remove(struct platform_device *device)
 +static void smbus_cmi_remove(struct platform_device *device)
  {
        struct acpi_smbus_cmi *smbus_cmi = platform_get_drvdata(device);
  
        i2c_del_adapter(&smbus_cmi->adapter);
        kfree(smbus_cmi);
 -
 -      return 0;
  }
  
  static struct platform_driver smbus_cmi_driver = {
        .probe = smbus_cmi_probe,
 -      .remove = smbus_cmi_remove,
 +      .remove_new = smbus_cmi_remove,
        .driver = {
                .name   = "smbus_cmi",
                .acpi_match_table = acpi_smbus_cmi_ids,
diff --combined include/linux/acpi.h
@@@ -70,6 -70,19 +70,6 @@@ static inline void acpi_free_fwnode_sta
        kfree(fwnode);
  }
  
 -/**
 - * ACPI_DEVICE_CLASS - macro used to describe an ACPI device with
 - * the PCI-defined class-code information
 - *
 - * @_cls : the class, subclass, prog-if triple for this device
 - * @_msk : the class mask for this device
 - *
 - * This macro is used to create a struct acpi_device_id that matches a
 - * specific PCI class. The .id and .driver_data fields will be left
 - * initialized with the default value.
 - */
 -#define ACPI_DEVICE_CLASS(_cls, _msk) .cls = (_cls), .cls_msk = (_msk),
 -
  static inline bool has_acpi_companion(struct device *dev)
  {
        return is_acpi_device_node(dev->fwnode);
@@@ -401,8 -414,6 +401,8 @@@ extern bool acpi_is_pnp_device(struct a
  
  typedef void (*wmi_notify_handler) (u32 value, void *context);
  
 +int wmi_instance_count(const char *guid);
 +
  extern acpi_status wmi_evaluate_method(const char *guid, u8 instance,
                                        u32 method_id,
                                        const struct acpi_buffer *in,
@@@ -701,12 -712,16 +701,15 @@@ int acpi_match_platform_list(const stru
  
  extern void acpi_early_init(void);
  extern void acpi_subsystem_init(void);
 -extern void arch_post_acpi_subsys_init(void);
  
  extern int acpi_nvs_register(__u64 start, __u64 size);
  
  extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
                                    void *data);
  
+ const struct acpi_device_id *acpi_match_acpi_device(const struct acpi_device_id *ids,
+                                                   const struct acpi_device *adev);
  const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
                                               const struct device *dev);
  
@@@ -769,6 -784,7 +772,6 @@@ const char *acpi_get_subsystem_id(acpi_
  #define ACPI_COMPANION_SET(dev, adev) do { } while (0)
  #define ACPI_HANDLE(dev)              (NULL)
  #define ACPI_HANDLE_FWNODE(fwnode)    (NULL)
 -#define ACPI_DEVICE_CLASS(_cls, _msk) .cls = (0), .cls_msk = (0),
  
  #include <acpi/acpi_numa.h>
  
@@@ -922,6 -938,12 +925,12 @@@ static inline int acpi_nvs_for_each_reg
  
  struct acpi_device_id;
  
+ static inline const struct acpi_device_id *acpi_match_acpi_device(
+       const struct acpi_device_id *ids, const struct acpi_device *adev)
+ {
+       return NULL;
+ }
  static inline const struct acpi_device_id *acpi_match_device(
        const struct acpi_device_id *ids, const struct device *dev)
  {
@@@ -1071,8 -1093,6 +1080,8 @@@ static inline bool acpi_sleep_state_sup
  
  #endif        /* !CONFIG_ACPI */
  
 +extern void arch_post_acpi_subsys_init(void);
 +
  #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC
  int acpi_ioapic_add(acpi_handle root);
  #else