diff options
author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2013-11-14 07:03:51 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-14 17:20:45 -0500 |
commit | 45c42a7f582cc07259bc78910de8b0b1c94094d5 (patch) | |
tree | b932525f93bd44a4b3be6cc71b54b6a7cbb7d82c | |
parent | a104b4d467d1c4a09727bac2816928aef3304d3a (diff) |
ACPI: Provide acpi_dev_name accessor for struct acpi_device device name
struct acpi_device fields are only available when CONFIG_ACPI is set. We may
find use for dev_name(&adev->dev) in generic code that is build also without
CONFIG_ACPI is set but currently this requires #ifdef CONFIG_ACPI churn.
Provide here an accessor that returns dev_name of embedded struct device dev
in struct acpi_device or NULL depending on CONFIG_ACPI setting.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | include/linux/acpi.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 86a3ba99a38d..d9099b15b472 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -53,6 +53,11 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev) | |||
53 | #define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev) | 53 | #define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev) |
54 | #define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev)) | 54 | #define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev)) |
55 | 55 | ||
56 | static inline const char *acpi_dev_name(struct acpi_device *adev) | ||
57 | { | ||
58 | return dev_name(&adev->dev); | ||
59 | } | ||
60 | |||
56 | enum acpi_irq_model_id { | 61 | enum acpi_irq_model_id { |
57 | ACPI_IRQ_MODEL_PIC = 0, | 62 | ACPI_IRQ_MODEL_PIC = 0, |
58 | ACPI_IRQ_MODEL_IOAPIC, | 63 | ACPI_IRQ_MODEL_IOAPIC, |
@@ -414,6 +419,11 @@ static inline bool acpi_driver_match_device(struct device *dev, | |||
414 | #define ACPI_COMPANION_SET(dev, adev) do { } while (0) | 419 | #define ACPI_COMPANION_SET(dev, adev) do { } while (0) |
415 | #define ACPI_HANDLE(dev) (NULL) | 420 | #define ACPI_HANDLE(dev) (NULL) |
416 | 421 | ||
422 | static inline const char *acpi_dev_name(struct acpi_device *adev) | ||
423 | { | ||
424 | return NULL; | ||
425 | } | ||
426 | |||
417 | static inline void acpi_early_init(void) { } | 427 | static inline void acpi_early_init(void) { } |
418 | 428 | ||
419 | static inline int early_acpi_boot_init(void) | 429 | static inline int early_acpi_boot_init(void) |