Re: [PATCH 4/5] lis3: solve dependency between core and ACPI
From: Ãric Piel
Date: Sun Mar 22 2009 - 19:25:34 EST
Daniel Mack schreef:
> This solves the dependency between lis3lv02d.[ch] and ACPI specific
> methods. It introduces a ->bus_priv pointer to the device struct which
> is casted to 'struct acpi_device' in the ACIP layer. Changed hp_accel.c
> accordingly.
Sorry for the long delay. Eventually I've found time to test the patch
and fix a bug: the axis conversion was set too late, preventing the
calibration to work.
The attached patch should make your modifications fully working with the
hp laptops :-)
I guess the best is to fold it into your patch and I'll ack the new
version.
Eric
=
Must put the axis info before using it.
---
drivers/hwmon/hp_accel.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/hwmon/hp_accel.c b/drivers/hwmon/hp_accel.c
index 363220b..b6c32c5 100644
--- a/drivers/hwmon/hp_accel.c
+++ b/drivers/hwmon/hp_accel.c
@@ -287,11 +287,6 @@ static int lis3lv02d_add(struct acpi_device *device)
/* obtain IRQ number of our device from ACPI */
lis3lv02d_enum_resources(device);
- /* call the core layer do its init */
- ret = lis3lv02d_init_device(&lis3_dev);
- if (ret)
- return ret;
-
/* If possible use a "standard" axes order */
if (dmi_check_system(lis3lv02d_dmi_ids) == 0) {
printk(KERN_INFO DRIVER_NAME ": laptop model unknown, "
@@ -299,6 +294,11 @@ static int lis3lv02d_add(struct acpi_device *device)
lis3_dev.ac = lis3lv02d_axis_normal;
}
+ /* call the core layer do its init */
+ ret = lis3lv02d_init_device(&lis3_dev);
+ if (ret)
+ return ret;
+
INIT_WORK(&hpled_led.work, delayed_set_status_worker);
ret = led_classdev_register(NULL, &hpled_led.led_classdev);
if (ret) {
--
1.6.2.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/