diff options
-rw-r--r-- | drivers/pnp/resource.c | 18 | ||||
-rw-r--r-- | include/linux/pnp.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index f604061d2bb0..ba9765427886 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c | |||
@@ -638,6 +638,24 @@ int pnp_possible_config(struct pnp_dev *dev, int type, resource_size_t start, | |||
638 | } | 638 | } |
639 | EXPORT_SYMBOL(pnp_possible_config); | 639 | EXPORT_SYMBOL(pnp_possible_config); |
640 | 640 | ||
641 | int pnp_range_reserved(resource_size_t start, resource_size_t end) | ||
642 | { | ||
643 | struct pnp_dev *dev; | ||
644 | struct pnp_resource *pnp_res; | ||
645 | resource_size_t *dev_start, *dev_end; | ||
646 | |||
647 | pnp_for_each_dev(dev) { | ||
648 | list_for_each_entry(pnp_res, &dev->resources, list) { | ||
649 | dev_start = &pnp_res->res.start; | ||
650 | dev_end = &pnp_res->res.end; | ||
651 | if (ranged_conflict(&start, &end, dev_start, dev_end)) | ||
652 | return 1; | ||
653 | } | ||
654 | } | ||
655 | return 0; | ||
656 | } | ||
657 | EXPORT_SYMBOL(pnp_range_reserved); | ||
658 | |||
641 | /* format is: pnp_reserve_irq=irq1[,irq2] .... */ | 659 | /* format is: pnp_reserve_irq=irq1[,irq2] .... */ |
642 | static int __init pnp_setup_reserve_irq(char *str) | 660 | static int __init pnp_setup_reserve_irq(char *str) |
643 | { | 661 | { |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index ca3c88773028..b063c7328ba5 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -446,6 +446,7 @@ int pnp_start_dev(struct pnp_dev *dev); | |||
446 | int pnp_stop_dev(struct pnp_dev *dev); | 446 | int pnp_stop_dev(struct pnp_dev *dev); |
447 | int pnp_activate_dev(struct pnp_dev *dev); | 447 | int pnp_activate_dev(struct pnp_dev *dev); |
448 | int pnp_disable_dev(struct pnp_dev *dev); | 448 | int pnp_disable_dev(struct pnp_dev *dev); |
449 | int pnp_range_reserved(resource_size_t start, resource_size_t end); | ||
449 | 450 | ||
450 | /* protocol helpers */ | 451 | /* protocol helpers */ |
451 | int pnp_is_active(struct pnp_dev *dev); | 452 | int pnp_is_active(struct pnp_dev *dev); |
@@ -476,6 +477,7 @@ static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; } | |||
476 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } | 477 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } |
477 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } | 478 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } |
478 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } | 479 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } |
480 | static inline int pnp_range_reserved(resource_size_t start, resource_size_t end) { return 0;} | ||
479 | 481 | ||
480 | /* protocol helpers */ | 482 | /* protocol helpers */ |
481 | static inline int pnp_is_active(struct pnp_dev *dev) { return 0; } | 483 | static inline int pnp_is_active(struct pnp_dev *dev) { return 0; } |