summaryrefslogtreecommitdiffstats
path: root/drivers/net/wimax/i2400m/driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wimax/i2400m/driver.c')
-rw-r--r--drivers/net/wimax/i2400m/driver.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/net/wimax/i2400m/driver.c b/drivers/net/wimax/i2400m/driver.c
index c57020f811cd..4fcdb18261fd 100644
--- a/drivers/net/wimax/i2400m/driver.c
+++ b/drivers/net/wimax/i2400m/driver.c
@@ -723,12 +723,13 @@ int i2400m_dev_reset_handle(struct i2400m *i2400m, const char *reason)
EXPORT_SYMBOL_GPL(i2400m_dev_reset_handle);
-/**
- * i2400m_bm_buf_alloc - Alloc the command and ack buffers for boot mode
+/*
+ * Alloc the command and ack buffers for boot mode
*
* Get the buffers needed to deal with boot mode messages. These
* buffers need to be allocated before the sdio recieve irq is setup.
*/
+static
int i2400m_bm_buf_alloc(struct i2400m *i2400m)
{
int result;
@@ -747,22 +748,19 @@ error_bm_ack_buf_kzalloc:
error_bm_cmd_kzalloc:
return result;
}
-EXPORT_SYMBOL_GPL(i2400m_bm_buf_alloc);
-/**
- * i2400m_bm_buf_free - Free boot mode command and ack buffers.
- *
- * Free the command and ack buffers
- *
+
+/*
+ * Free boot mode command and ack buffers.
*/
+static
void i2400m_bm_buf_free(struct i2400m *i2400m)
{
kfree(i2400m->bm_ack_buf);
kfree(i2400m->bm_cmd_buf);
- return;
}
-EXPORT_SYMBOL_GPL(i2400m_bm_buf_free
-);
+
+
/**
* i2400m_setup - bus-generic setup function for the i2400m device
*
@@ -786,6 +784,12 @@ int i2400m_setup(struct i2400m *i2400m, enum i2400m_bri bm_flags)
snprintf(wimax_dev->name, sizeof(wimax_dev->name),
"i2400m-%s:%s", dev->bus->name, dev_name(dev));
+ result = i2400m_bm_buf_alloc(i2400m);
+ if (result < 0) {
+ dev_err(dev, "cannot allocate bootmode scratch buffers\n");
+ goto error_bm_buf_alloc;
+ }
+
if (i2400m->bus_setup) {
result = i2400m->bus_setup(i2400m);
if (result < 0) {
@@ -860,6 +864,8 @@ error_bootrom_init:
if (i2400m->bus_release)
i2400m->bus_release(i2400m);
error_bus_setup:
+ i2400m_bm_buf_free(i2400m);
+error_bm_buf_alloc:
d_fnend(3, dev, "(i2400m %p) = %d\n", i2400m, result);
return result;
}
OpenPOWER on IntegriCloud