aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/osl.c9
-rw-r--r--drivers/hwmon/asus_atk0110.c7
-rw-r--r--include/linux/acpi.h2
3 files changed, 18 insertions, 0 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 4bc1c4178f50..78418ce4fc78 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -1207,6 +1207,15 @@ int acpi_check_mem_region(resource_size_t start, resource_size_t n,
1207EXPORT_SYMBOL(acpi_check_mem_region); 1207EXPORT_SYMBOL(acpi_check_mem_region);
1208 1208
1209/* 1209/*
1210 * Let drivers know whether the resource checks are effective
1211 */
1212int acpi_resources_are_enforced(void)
1213{
1214 return acpi_enforce_resources == ENFORCE_RESOURCES_STRICT;
1215}
1216EXPORT_SYMBOL(acpi_resources_are_enforced);
1217
1218/*
1210 * Acquire a spinlock. 1219 * Acquire a spinlock.
1211 * 1220 *
1212 * handle is a pointer to the spinlock_t. 1221 * handle is a pointer to the spinlock_t.
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c
index 16c420240724..653db1bda934 100644
--- a/drivers/hwmon/asus_atk0110.c
+++ b/drivers/hwmon/asus_atk0110.c
@@ -1411,6 +1411,13 @@ static int __init atk0110_init(void)
1411{ 1411{
1412 int ret; 1412 int ret;
1413 1413
1414 /* Make sure it's safe to access the device through ACPI */
1415 if (!acpi_resources_are_enforced()) {
1416 pr_err("atk: Resources not safely usable due to "
1417 "acpi_enforce_resources kernel parameter\n");
1418 return -EBUSY;
1419 }
1420
1414 ret = acpi_bus_register_driver(&atk_driver); 1421 ret = acpi_bus_register_driver(&atk_driver);
1415 if (ret) 1422 if (ret)
1416 pr_info("atk: acpi_bus_register_driver failed: %d\n", ret); 1423 pr_info("atk: acpi_bus_register_driver failed: %d\n", ret);
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 3da73f5f0ae9..2c60f1f70b38 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -248,6 +248,8 @@ int acpi_check_region(resource_size_t start, resource_size_t n,
248int acpi_check_mem_region(resource_size_t start, resource_size_t n, 248int acpi_check_mem_region(resource_size_t start, resource_size_t n,
249 const char *name); 249 const char *name);
250 250
251int acpi_resources_are_enforced(void);
252
251#ifdef CONFIG_PM_SLEEP 253#ifdef CONFIG_PM_SLEEP
252void __init acpi_no_s4_hw_signature(void); 254void __init acpi_no_s4_hw_signature(void);
253void __init acpi_old_suspend_ordering(void); 255void __init acpi_old_suspend_ordering(void);