mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> [[email protected]: fixed up exports et al] Signed-off-by: Andy Whitcroft <[email protected]> Signed-off-by: Eric Anholt <[email protected]>
This commit is contained in:
parent
b66d18ddb1
commit
1b8e69662e
2 changed files with 20 additions and 0 deletions
|
|
@ -638,6 +638,24 @@ int pnp_possible_config(struct pnp_dev *dev, int type, resource_size_t start,
|
|||
}
|
||||
EXPORT_SYMBOL(pnp_possible_config);
|
||||
|
||||
int pnp_range_reserved(resource_size_t start, resource_size_t end)
|
||||
{
|
||||
struct pnp_dev *dev;
|
||||
struct pnp_resource *pnp_res;
|
||||
resource_size_t *dev_start, *dev_end;
|
||||
|
||||
pnp_for_each_dev(dev) {
|
||||
list_for_each_entry(pnp_res, &dev->resources, list) {
|
||||
dev_start = &pnp_res->res.start;
|
||||
dev_end = &pnp_res->res.end;
|
||||
if (ranged_conflict(&start, &end, dev_start, dev_end))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(pnp_range_reserved);
|
||||
|
||||
/* format is: pnp_reserve_irq=irq1[,irq2] .... */
|
||||
static int __init pnp_setup_reserve_irq(char *str)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue