Subject: [PATCH] [acpi driver model] Add interface for adding/removing drivers - Create drivers/acpi/drivers/core/driver.c. - Implement simple acpi_driver_{,un}register(). Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/core/Makefile | 2 + drivers/acpi/drivers/core/driver.c | 57 ++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletions(-) create mode 100644 drivers/acpi/drivers/core/driver.c applies-to: d75d0868b6aaabc084dbc6ca347f62b7643f5624 a35d91408274c553bfd741caaa9939ddf583cc9f diff --git a/drivers/acpi/drivers/core/Makefile b/drivers/acpi/drivers/core/Makefile index f533f7c..cd7c779 100644 --- a/drivers/acpi/drivers/core/Makefile +++ b/drivers/acpi/drivers/core/Makefile @@ -1,4 +1,4 @@ -obj-y := bus.o device.o +obj-y := bus.o device.o driver.o obj-y += lib.o diff --git a/drivers/acpi/drivers/core/driver.c b/drivers/acpi/drivers/core/driver.c new file mode 100644 index 0000000..6e37faa --- /dev/null +++ b/drivers/acpi/drivers/core/driver.c @@ -0,0 +1,57 @@ +/*** + * + * drivers/acpi/drivers/core/driver.c - ACPI driver management + * + * Copyright (C) 2006 Patrick Mochel + * + * This file is released under the GPLv2. + * + * + * This file contains the code to manage the drivers for ACPI + * devices. It contains the registration/unregistration interface, + * as well as all of the pass-through methods that the Linux + * driver core will call (and that are forwarded on to the ACPI + * drivers). + */ + +#include "core.h" + + +/** + * acpi_driver_register - Register an ACPI driver + * @drv: The ACPI driver to register + * + * This fills in some of the necessary fields (mainly + * the methods listed above) and registers the driver + * with the Linux driver core. + */ + +int acpi_driver_register(struct acpi_device_driver * drv) +{ + + dbg("Registering driver %s", drv->d_drv.name); + + drv->d_drv.bus = &acpi_bus; + + /* + * Register driver with core + */ + return driver_register(&drv->d_drv); +} + +EXPORT_SYMBOL_GPL(acpi_driver_register); + + +/** + * acpi_driver_unregister - Remove a driver + * @drv: The ACPI driver to unregister. + * + */ + +void acpi_driver_unregister(struct acpi_device_driver * drv) +{ + +} + +EXPORT_SYMBOL_GPL(acpi_driver_unregister); + --- 0.99.9.GIT