Commit ad6b01f2 authored by Russell King's avatar Russell King

[ARM] Add ecard_(request|release)_resources().

parent 44569f92
...@@ -908,6 +908,42 @@ static ssize_t ecard_show_device(struct device *dev, char *buf) ...@@ -908,6 +908,42 @@ static ssize_t ecard_show_device(struct device *dev, char *buf)
static DEVICE_ATTR(device, S_IRUGO, ecard_show_device, NULL); static DEVICE_ATTR(device, S_IRUGO, ecard_show_device, NULL);
int ecard_request_resources(struct expansion_card *ec)
{
int i, err = 0;
for (i = 0; i < ECARD_NUM_RESOURCES; i++) {
if (ecard_resource_end(ec, i) &&
!request_mem_region(ecard_resource_start(ec, i),
ecard_resource_len(ec, i),
ec->dev.driver->name)) {
err = -EBUSY;
break;
}
}
if (err) {
while (i--)
if (ecard_resource_end(ec, i))
release_mem_region(ecard_resource_start(ec, i),
ecard_resource_len(ec, i));
}
return err;
}
EXPORT_SYMBOL(ecard_request_resources);
void ecard_release_resources(struct expansion_card *ec)
{
int i;
for (i = 0; i < ECARD_NUM_RESOURCES; i++)
if (ecard_resource_end(ec, i))
release_mem_region(ecard_resource_start(ec, i),
ecard_resource_len(ec, i));
}
EXPORT_SYMBOL(ecard_release_resources);
/* /*
* Probe for an expansion card. * Probe for an expansion card.
* *
......
...@@ -208,7 +208,13 @@ extern int ecard_readchunk (struct in_chunk_dir *cd, struct expansion_card *ec, ...@@ -208,7 +208,13 @@ extern int ecard_readchunk (struct in_chunk_dir *cd, struct expansion_card *ec,
/* /*
* Obtain the address of a card * Obtain the address of a card
*/ */
extern unsigned int ecard_address (struct expansion_card *ec, card_type_t card_type, card_speed_t speed); extern __deprecated unsigned int ecard_address (struct expansion_card *ec, card_type_t card_type, card_speed_t speed);
/*
* Request and release ecard resources
*/
extern int ecard_request_resources(struct expansion_card *ec);
extern void ecard_release_resources(struct expansion_card *ec);
#ifdef ECARD_C #ifdef ECARD_C
/* Definitions internal to ecard.c - for it's use only!! /* Definitions internal to ecard.c - for it's use only!!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment