Skip to content

Commit 007cfa1

Browse files
andy-shevgregkh
authored andcommitted
ACPI: Move ACPI_DEVICE_CLASS() to mod_devicetable.h
The data type of struct acpi_device_id is defined in the mod_devicetable.h. It's suboptimal to require user with the almost agnostic code to include acpi.h solely for the macro that affects the data type defined elsewhere. Taking into account the above and for the sake of consistency move ACPI_DEVICE_CLASS() to mod_devicetable.h. Note, that with CONFIG_ACPI=n the ID table will be filed with data but it does not really matter because either it won't be used, or won't be compiled in some cases (when guarded by respective ifdeffery). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Message-ID: <20230609154900.43024-2-andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 16b5842 commit 007cfa1

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

include/linux/acpi.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,6 @@ static inline void acpi_free_fwnode_static(struct fwnode_handle *fwnode)
7070
kfree(fwnode);
7171
}
7272

73-
/**
74-
* ACPI_DEVICE_CLASS - macro used to describe an ACPI device with
75-
* the PCI-defined class-code information
76-
*
77-
* @_cls : the class, subclass, prog-if triple for this device
78-
* @_msk : the class mask for this device
79-
*
80-
* This macro is used to create a struct acpi_device_id that matches a
81-
* specific PCI class. The .id and .driver_data fields will be left
82-
* initialized with the default value.
83-
*/
84-
#define ACPI_DEVICE_CLASS(_cls, _msk) .cls = (_cls), .cls_msk = (_msk),
85-
8673
static inline bool has_acpi_companion(struct device *dev)
8774
{
8875
return is_acpi_device_node(dev->fwnode);
@@ -781,7 +768,6 @@ const char *acpi_get_subsystem_id(acpi_handle handle);
781768
#define ACPI_COMPANION_SET(dev, adev) do { } while (0)
782769
#define ACPI_HANDLE(dev) (NULL)
783770
#define ACPI_HANDLE_FWNODE(fwnode) (NULL)
784-
#define ACPI_DEVICE_CLASS(_cls, _msk) .cls = (0), .cls_msk = (0),
785771

786772
#include <acpi/acpi_numa.h>
787773

include/linux/mod_devicetable.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,19 @@ struct acpi_device_id {
221221
__u32 cls_msk;
222222
};
223223

224+
/**
225+
* ACPI_DEVICE_CLASS - macro used to describe an ACPI device with
226+
* the PCI-defined class-code information
227+
*
228+
* @_cls : the class, subclass, prog-if triple for this device
229+
* @_msk : the class mask for this device
230+
*
231+
* This macro is used to create a struct acpi_device_id that matches a
232+
* specific PCI class. The .id and .driver_data fields will be left
233+
* initialized with the default value.
234+
*/
235+
#define ACPI_DEVICE_CLASS(_cls, _msk) .cls = (_cls), .cls_msk = (_msk),
236+
224237
#define PNP_ID_LEN 8
225238
#define PNP_MAX_DEVICES 8
226239

0 commit comments

Comments
 (0)