Subject: [PATCH] [ACPI] Add a couple of basic library functions - To help ween drivers (and the core) from using the struct acpi_device, define acpi_dev_hid() and acpi_dev_bid() to access the relevant fields. Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/core/Makefile | 1 + drivers/acpi/drivers/core/lib.c | 16 ++++++++++++++++ include/acpi/device.h | 6 ++++++ 3 files changed, 23 insertions(+), 0 deletions(-) create mode 100644 drivers/acpi/drivers/core/lib.c applies-to: d1efa56976782437cfbb253364592d4b24fb6f85 84b9495955d304a82456cfe4a82cc647b75ad324 diff --git a/drivers/acpi/drivers/core/Makefile b/drivers/acpi/drivers/core/Makefile index ec8bc12..65a03b8 100644 --- a/drivers/acpi/drivers/core/Makefile +++ b/drivers/acpi/drivers/core/Makefile @@ -1,3 +1,4 @@ obj-y := bus.o +obj-y := lib.o diff --git a/drivers/acpi/drivers/core/lib.c b/drivers/acpi/drivers/core/lib.c new file mode 100644 index 0000000..39a2d90 --- /dev/null +++ b/drivers/acpi/drivers/core/lib.c @@ -0,0 +1,16 @@ + +#include + +char * acpi_dev_bid(struct acpi_dev * ad) +{ + return acpi_device_bid(ad->acpi_device); +} + +EXPORT_SYMBOL_GPL(acpi_dev_bid); + +char * acpi_dev_hid(struct acpi_dev * ad) +{ + return acpi_device_hid(ad->acpi_device); +} + +EXPORT_SYMBOL_GPL(acpi_dev_hid); diff --git a/include/acpi/device.h b/include/acpi/device.h index e5c2751..4780276 100644 --- a/include/acpi/device.h +++ b/include/acpi/device.h @@ -20,4 +20,10 @@ struct acpi_device_driver { }; +/* + * Library functions for new drivers + */ +extern char * acpi_dev_bid(struct acpi_dev *); +extern char * acpi_dev_hid(struct acpi_dev *); + #endif /* _INCLUDE_ACPI_DEVICE_ */ --- 0.99.9.GIT