diff options
author | Bjorn Helgaas <bjorn.helgaas at hp.com> | 2009-06-05 10:37:23 -0400 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-06-05 10:37:41 -0400 |
commit | 1b8e69662e1a086878bf930a6042daf7f8a076cc (patch) | |
tree | 20b9559e2ac41189c5c72ee7fab19ea781d97e3e /drivers/pnp | |
parent | b66d18ddb16603d1e1ec39cb2ff3abf3fd212180 (diff) |
pnp: add PNP resource range checking function
Add a PNP resource range check function, indicating whether a resource
has been assigned to any device.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
[apw@canonical.com: fixed up exports et al]
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/pnp')
-rw-r--r-- | drivers/pnp/resource.c | 18 |
1 files changed, 18 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 | { |