--Boundary-01=_/I5JHY9F5ppequm
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Let's make it consistent with battery code; also it fixes HAL case of=20
duplicated adapters. Somebody will have to sort out HAL with ACPI_PROCFS=20
case ...
=2Dandrey
--Boundary-01=_/I5JHY9F5ppequm
Content-Type: text/x-diff;
charset="us-ascii";
name="ac_adapter-without-procfs"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
filename="ac_adapter-without-procfs"
Subject: [PATCH] 2.6.24: make /proc/acpi/ac_adapter dependent on ACPI_PROCFS
=46rom: Andrey Borzenkov <arvidjaar@mail.ru>
Do not provide /proc/acpi/ac_adapter if ACPI_PROCFS is not defined.
This eliminates duplicated power adapters in HAL and makes it consistent
with battery module
Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
=2D--
drivers/acpi/ac.c | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index e03de37..1461dc9 100644
=2D-- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -27,8 +27,10 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
+#ifdef CONFIG_ACPI_PROCFS
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
+#endif
#include <linux/power_supply.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
@@ -49,12 +51,14 @@ MODULE_AUTHOR("Paul Diefenbaugh");
MODULE_DESCRIPTION("ACPI AC Adapter Driver");
MODULE_LICENSE("GPL");
=20
+#ifdef CONFIG_ACPI_PROCFS
extern struct proc_dir_entry *acpi_lock_ac_dir(void);
extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);
+static int acpi_ac_open_fs(struct inode *inode, struct file *file);
+#endif
=20
static int acpi_ac_add(struct acpi_device *device);
static int acpi_ac_remove(struct acpi_device *device, int type);
=2Dstatic int acpi_ac_open_fs(struct inode *inode, struct file *file);
=20
const static struct acpi_device_id ac_device_ids[] =3D {
{"ACPI0003", 0},
@@ -80,12 +84,15 @@ struct acpi_ac {
=20
#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger);
=20
+#ifdef CONFIG_ACPI_PROCFS
static const struct file_operations acpi_ac_fops =3D {
.open =3D acpi_ac_open_fs,
.read =3D seq_read,
.llseek =3D seq_lseek,
.release =3D single_release,
};
+#endif
+
static int get_ac_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
@@ -127,6 +134,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
return 0;
}
=20
+#ifdef CONFIG_ACPI_PROCFS
/* -----------------------------------------------------------------------=
=2D--
FS Interface (/proc)
-----------------------------------------------------------------------=
=2D-- */
@@ -206,6 +214,7 @@ static int acpi_ac_remove_fs(struct acpi_device *device)
=20
return 0;
}
+#endif
=20
/* -----------------------------------------------------------------------=
=2D--
Driver Model
@@ -264,7 +273,9 @@ static int acpi_ac_add(struct acpi_device *device)
if (result)
goto end;
=20
+#ifdef CONFIG_ACPI_PROCFS
result =3D acpi_ac_add_fs(device);
+#endif
if (result)
goto end;
ac->charger.name =3D acpi_device_bid(device);
@@ -287,7 +298,9 @@ static int acpi_ac_add(struct acpi_device *device)
=20
end:
if (result) {
+#ifdef CONFIG_ACPI_PROCFS
acpi_ac_remove_fs(device);
+#endif
kfree(ac);
}
=20
@@ -309,7 +322,9 @@ static int acpi_ac_remove(struct acpi_device *device, i=
nt type)
ACPI_ALL_NOTIFY, acpi_ac_notify);
if (ac->charger.dev)
power_supply_unregister(&ac->charger);
+#ifdef CONFIG_ACPI_PROCFS
acpi_ac_remove_fs(device);
+#endif
=20
kfree(ac);
=20
@@ -323,13 +338,17 @@ static int __init acpi_ac_init(void)
if (acpi_disabled)
return -ENODEV;
=20
+#ifdef CONFIG_ACPI_PROCFS
acpi_ac_dir =3D acpi_lock_ac_dir();
if (!acpi_ac_dir)
return -ENODEV;
+#endif
=20
result =3D acpi_bus_register_driver(&acpi_ac_driver);
if (result < 0) {
+#ifdef CONFIG_ACPI_PROCFS
acpi_unlock_ac_dir(acpi_ac_dir);
+#endif
return -ENODEV;
}
=20
@@ -341,7 +360,9 @@ static void __exit acpi_ac_exit(void)
=20
acpi_bus_unregister_driver(&acpi_ac_driver);
=20
+#ifdef CONFIG_ACPI_PROCFS
acpi_unlock_ac_dir(acpi_ac_dir);
+#endif
=20
return;
}
--Boundary-01=_/I5JHY9F5ppequm--| Faik Uygur | Re: Linux 2.6.21-rc1 |
| pageexec | Re: [stable] Linux 2.6.25.10 |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Mark Lord | Re: 2.6.25-rc8: FTP transfer errors |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
