Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151850135
D54420.id169802.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D54420.id169802.diff
View Options
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -4334,6 +4334,21 @@
ACPI_UNLOCK(acpi);
}
+void
+acpi_deregister_ioctls(acpi_ioctl_fn fn)
+{
+ struct acpi_ioctl_hook *hp, *thp;
+
+ ACPI_LOCK(acpi);
+ TAILQ_FOREACH_SAFE(hp, &acpi_ioctl_hooks, link, thp) {
+ if (hp->fn == fn) {
+ TAILQ_REMOVE(&acpi_ioctl_hooks, hp, link);
+ free(hp, M_ACPIDEV);
+ }
+ }
+ ACPI_UNLOCK(acpi);
+}
+
static int
acpiopen(struct cdev *dev, int flag, int fmt, struct thread *td)
{
diff --git a/sys/dev/acpica/acpi_battery.c b/sys/dev/acpica/acpi_battery.c
--- a/sys/dev/acpica/acpi_battery.c
+++ b/sys/dev/acpica/acpi_battery.c
@@ -531,13 +531,7 @@
out:
if (error) {
- acpi_deregister_ioctl(ACPIIO_BATT_GET_UNITS, acpi_battery_ioctl);
- acpi_deregister_ioctl(ACPIIO_BATT_GET_BATTINFO, acpi_battery_ioctl);
- acpi_deregister_ioctl(ACPIIO_BATT_GET_BATTINFO_V1, acpi_battery_ioctl);
- acpi_deregister_ioctl(ACPIIO_BATT_GET_BIF, acpi_battery_ioctl);
- acpi_deregister_ioctl(ACPIIO_BATT_GET_BIX, acpi_battery_ioctl);
- acpi_deregister_ioctl(ACPIIO_BATT_GET_BST, acpi_battery_ioctl);
- acpi_deregister_ioctl(ACPIIO_BATT_GET_BST_V1, acpi_battery_ioctl);
+ acpi_deregister_ioctls(acpi_battery_ioctl);
}
return (error);
}
diff --git a/sys/dev/acpica/acpiio.h b/sys/dev/acpica/acpiio.h
--- a/sys/dev/acpica/acpiio.h
+++ b/sys/dev/acpica/acpiio.h
@@ -205,6 +205,7 @@
typedef int (*acpi_ioctl_fn)(u_long cmd, caddr_t addr, void *arg);
extern int acpi_register_ioctl(u_long cmd, acpi_ioctl_fn fn, void *arg);
extern void acpi_deregister_ioctl(u_long cmd, acpi_ioctl_fn fn);
+extern void acpi_deregister_ioctls(acpi_ioctl_fn fn);
#endif
#endif /* !_ACPIIO_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 12, 2:24 AM (6 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31323524
Default Alt Text
D54420.id169802.diff (1 KB)
Attached To
Mode
D54420: acpi: Add a function to deregister all ioctl commands using the same function
Attached
Detach File
Event Timeline
Log In to Comment