]> Git Repo - linux.git/commitdiff
Merge branches 'acpi-bus' and 'acpi-scan'
authorRafael J. Wysocki <[email protected]>
Thu, 6 Jul 2023 17:24:06 +0000 (19:24 +0200)
committerRafael J. Wysocki <[email protected]>
Thu, 6 Jul 2023 17:24:06 +0000 (19:24 +0200)
Merge additional ACPI device enumeration code changes for 6.5-rc1.

 - 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).

* acpi-bus:
  ACPI: bus: Constify acpi_companion_match() returned value

* acpi-scan:
  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: scan: Move acpi_root to internal header

1  2  3 
drivers/acpi/bus.c
drivers/acpi/internal.h

diff --combined drivers/acpi/bus.c
index e3e0bd0c5a5055245d604a3e4d87bf9170fcc8fc,20cdfb37da79f856b31edfdc1a0993ed53a9f74d,8c086c87cbb6bf175ee0fd3a1733f91400e6a023..2fc2b43a4ed3877e8a41a6f62d21b55340317723
@@@@ -682,7 -682,7 -682,7 +682,7 @@@@ bool acpi_device_is_first_physical_node
    * resources available from it but they will be matched normally using functions
    * provided by their bus types (and analogously for their modalias).
    */
- -struct acpi_device *acpi_companion_match(const struct device *dev)
+ +const struct acpi_device *acpi_companion_match(const struct device *dev)
   {
        struct acpi_device *adev;
   
    * identifiers and a _DSD object with the "compatible" property, use that
    * property to match against the given list of identifiers.
    */
- -static bool acpi_of_match_device(struct acpi_device *adev,
+ +static bool acpi_of_match_device(const struct acpi_device *adev,
                                 const struct of_device_id *of_match_table,
                                 const struct of_device_id **of_id)
   {
@@@@ -808,7 -808,7 -808,7 +808,7 @@@@ static bool __acpi_match_device_cls(con
        return true;
   }
   
- -static bool __acpi_match_device(struct acpi_device *device,
+ +static bool __acpi_match_device(const struct acpi_device *device,
                                const struct acpi_device_id *acpi_ids,
                                const struct of_device_id *of_ids,
                                const struct acpi_device_id **acpi_id,
@@@@ -850,6 -850,6 -850,26 +850,26 @@@@ out_acpi_match
        return true;
   }
   
++ /**
++  * acpi_match_acpi_device - Match an ACPI device against a given list of ACPI IDs
++  * @ids: Array of struct acpi_device_id objects to match against.
++  * @adev: The ACPI device pointer to match.
++  *
++  * Match the ACPI device @adev against a given list of ACPI IDs @ids.
++  *
++  * Return:
++  * a pointer to the first matching ACPI ID on success or %NULL on failure.
++  */
++ 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 *id = NULL;
++ 
++      __acpi_match_device(adev, ids, NULL, &id, NULL);
++      return id;
++ }
++ EXPORT_SYMBOL_GPL(acpi_match_acpi_device);
++ 
   /**
    * acpi_match_device - Match a struct device against a given list of ACPI IDs
    * @ids: Array of struct acpi_device_id object to match against.
   const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
                                               const struct device *dev)
   {
--      const struct acpi_device_id *id = NULL;
-- 
--      __acpi_match_device(acpi_companion_match(dev), ids, NULL, &id, NULL);
--      return id;
++      return acpi_match_acpi_device(ids, acpi_companion_match(dev));
   }
   EXPORT_SYMBOL_GPL(acpi_match_device);
   
diff --combined drivers/acpi/internal.h
index 06ad497067acf8709f18ab8fe8c21addbbff7edf,95501a14859151a83dbecb4d2c5dbbbceab16ef4,50dcb35c9965e33020640e6206506a2e6f04abe4..f4148dc50b9c233940c1054ab54a42a8d0727e5a
   
   #include <linux/idr.h>
   
++ extern struct acpi_device *acpi_root;
++ 
   int early_acpi_osi_init(void);
   int acpi_osi_init(void);
   acpi_status acpi_os_initialize1(void);
@@@@ -119,7 -119,7 -121,7 +121,7 @@@@ int acpi_bus_register_early_device(int 
   /* --------------------------------------------------------------------------
                        Device Matching and Notification
      -------------------------------------------------------------------------- */
- -struct acpi_device *acpi_companion_match(const struct device *dev);
+ +const struct acpi_device *acpi_companion_match(const struct device *dev);
   int __acpi_device_uevent_modalias(const struct acpi_device *adev,
                                  struct kobj_uevent_env *env);
   
This page took 0.070926 seconds and 4 git commands to generate.