diff options
-rw-r--r-- | drivers/pnp/driver.c | 2 | ||||
-rw-r--r-- | include/linux/pnp.h | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index f748cc8cbb03..4e57d3370368 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c | |||
@@ -182,7 +182,7 @@ static int __pnp_bus_suspend(struct device *dev, pm_message_t state) | |||
182 | return error; | 182 | return error; |
183 | } | 183 | } |
184 | 184 | ||
185 | if (pnp_dev->protocol->suspend) | 185 | if (pnp_can_suspend(pnp_dev)) |
186 | pnp_dev->protocol->suspend(pnp_dev, state); | 186 | pnp_dev->protocol->suspend(pnp_dev, state); |
187 | return 0; | 187 | return 0; |
188 | } | 188 | } |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 195aafc6cd07..6512e9cbc6d5 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/list.h> | 12 | #include <linux/list.h> |
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | #include <linux/mod_devicetable.h> | 14 | #include <linux/mod_devicetable.h> |
15 | #include <linux/console.h> | ||
15 | 16 | ||
16 | #define PNP_NAME_LEN 50 | 17 | #define PNP_NAME_LEN 50 |
17 | 18 | ||
@@ -309,15 +310,22 @@ struct pnp_fixup { | |||
309 | #define PNP_DISABLE 0x0004 | 310 | #define PNP_DISABLE 0x0004 |
310 | #define PNP_CONFIGURABLE 0x0008 | 311 | #define PNP_CONFIGURABLE 0x0008 |
311 | #define PNP_REMOVABLE 0x0010 | 312 | #define PNP_REMOVABLE 0x0010 |
313 | #define PNP_CONSOLE 0x0020 | ||
312 | 314 | ||
313 | #define pnp_can_read(dev) (((dev)->protocol->get) && \ | 315 | #define pnp_can_read(dev) (((dev)->protocol->get) && \ |
314 | ((dev)->capabilities & PNP_READ)) | 316 | ((dev)->capabilities & PNP_READ)) |
315 | #define pnp_can_write(dev) (((dev)->protocol->set) && \ | 317 | #define pnp_can_write(dev) (((dev)->protocol->set) && \ |
316 | ((dev)->capabilities & PNP_WRITE)) | 318 | ((dev)->capabilities & PNP_WRITE)) |
317 | #define pnp_can_disable(dev) (((dev)->protocol->disable) && \ | 319 | #define pnp_can_disable(dev) (((dev)->protocol->disable) && \ |
318 | ((dev)->capabilities & PNP_DISABLE)) | 320 | ((dev)->capabilities & PNP_DISABLE) && \ |
321 | (!((dev)->capabilities & PNP_CONSOLE) || \ | ||
322 | console_suspend_enabled)) | ||
319 | #define pnp_can_configure(dev) ((!(dev)->active) && \ | 323 | #define pnp_can_configure(dev) ((!(dev)->active) && \ |
320 | ((dev)->capabilities & PNP_CONFIGURABLE)) | 324 | ((dev)->capabilities & PNP_CONFIGURABLE)) |
325 | #define pnp_can_suspend(dev) (((dev)->protocol->suspend) && \ | ||
326 | (!((dev)->capabilities & PNP_CONSOLE) || \ | ||
327 | console_suspend_enabled)) | ||
328 | |||
321 | 329 | ||
322 | #ifdef CONFIG_ISAPNP | 330 | #ifdef CONFIG_ISAPNP |
323 | extern struct pnp_protocol isapnp_protocol; | 331 | extern struct pnp_protocol isapnp_protocol; |