diff options
author | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-10-07 23:33:50 -0400 |
---|---|---|
committer | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-10-19 02:56:23 -0400 |
commit | 097acbeff98178e01c2f6adb2259ab4d811340cc (patch) | |
tree | 72546c92d9438b1cad4dd7b37a3298a0763ff9fa | |
parent | 4a78fd9a736db4c871bc8b583d66b61c38abd299 (diff) |
wimax/i2400m: make i2400m->bus_dev_{stop,start}() optional
In coming commits, the i2400m SDIO driver will not use
i2400m->bus_dev_stop().
Thus changed to check before calling, as an empty stub has more
overhead than a call to check if the function pointer is non-NULL.
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
-rw-r--r-- | drivers/net/wimax/i2400m/driver.c | 14 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/i2400m.h | 14 |
2 files changed, 16 insertions, 12 deletions
diff --git a/drivers/net/wimax/i2400m/driver.c b/drivers/net/wimax/i2400m/driver.c index cc900b99e60a..cc58a864bd06 100644 --- a/drivers/net/wimax/i2400m/driver.c +++ b/drivers/net/wimax/i2400m/driver.c | |||
@@ -384,9 +384,11 @@ retry: | |||
384 | dev_err(dev, "cannot create workqueue\n"); | 384 | dev_err(dev, "cannot create workqueue\n"); |
385 | goto error_create_workqueue; | 385 | goto error_create_workqueue; |
386 | } | 386 | } |
387 | result = i2400m->bus_dev_start(i2400m); | 387 | if (i2400m->bus_dev_start) { |
388 | if (result < 0) | 388 | result = i2400m->bus_dev_start(i2400m); |
389 | goto error_bus_dev_start; | 389 | if (result < 0) |
390 | goto error_bus_dev_start; | ||
391 | } | ||
390 | i2400m->ready = 1; | 392 | i2400m->ready = 1; |
391 | wmb(); /* see i2400m->ready's documentation */ | 393 | wmb(); /* see i2400m->ready's documentation */ |
392 | /* process pending reports from the device */ | 394 | /* process pending reports from the device */ |
@@ -413,7 +415,8 @@ error_check_mac_addr: | |||
413 | wmb(); /* see i2400m->ready's documentation */ | 415 | wmb(); /* see i2400m->ready's documentation */ |
414 | flush_workqueue(i2400m->work_queue); | 416 | flush_workqueue(i2400m->work_queue); |
415 | error_fw_check: | 417 | error_fw_check: |
416 | i2400m->bus_dev_stop(i2400m); | 418 | if (i2400m->bus_dev_stop) |
419 | i2400m->bus_dev_stop(i2400m); | ||
417 | error_bus_dev_start: | 420 | error_bus_dev_start: |
418 | destroy_workqueue(i2400m->work_queue); | 421 | destroy_workqueue(i2400m->work_queue); |
419 | error_create_workqueue: | 422 | error_create_workqueue: |
@@ -480,7 +483,8 @@ void __i2400m_dev_stop(struct i2400m *i2400m) | |||
480 | wmb(); /* see i2400m->ready's documentation */ | 483 | wmb(); /* see i2400m->ready's documentation */ |
481 | flush_workqueue(i2400m->work_queue); | 484 | flush_workqueue(i2400m->work_queue); |
482 | 485 | ||
483 | i2400m->bus_dev_stop(i2400m); | 486 | if (i2400m->bus_dev_stop) |
487 | i2400m->bus_dev_stop(i2400m); | ||
484 | destroy_workqueue(i2400m->work_queue); | 488 | destroy_workqueue(i2400m->work_queue); |
485 | i2400m_rx_release(i2400m); | 489 | i2400m_rx_release(i2400m); |
486 | i2400m_tx_release(i2400m); | 490 | i2400m_tx_release(i2400m); |
diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h index 55bca430c69b..5eee985f2926 100644 --- a/drivers/net/wimax/i2400m/i2400m.h +++ b/drivers/net/wimax/i2400m/i2400m.h | |||
@@ -245,19 +245,19 @@ struct i2400m_barker_db; | |||
245 | * all the host resources created to handle communication with | 245 | * all the host resources created to handle communication with |
246 | * the device. | 246 | * the device. |
247 | * | 247 | * |
248 | * @bus_dev_start: [fill] Function called by the bus-generic code | 248 | * @bus_dev_start: [optional fill] Function called by the bus-generic |
249 | * [i2400m_dev_start()] to setup the bus-specific communications | 249 | * code [i2400m_dev_start()] to do things needed to start the |
250 | * to the the device. See LIFE CYCLE above. | 250 | * device. See LIFE CYCLE above. |
251 | * | 251 | * |
252 | * NOTE: Doesn't need to upload the firmware, as that is taken | 252 | * NOTE: Doesn't need to upload the firmware, as that is taken |
253 | * care of by the bus-generic code. | 253 | * care of by the bus-generic code. |
254 | * | 254 | * |
255 | * @bus_dev_stop: [fill] Function called by the bus-generic code | 255 | * @bus_dev_stop: [optional fill] Function called by the bus-generic |
256 | * [i2400m_dev_stop()] to shutdown the bus-specific communications | 256 | * code [i2400m_dev_stop()] to do things needed for stopping the |
257 | * to the the device. See LIFE CYCLE above. | 257 | * device. See LIFE CYCLE above. |
258 | * | 258 | * |
259 | * This function does not need to reset the device, just tear down | 259 | * This function does not need to reset the device, just tear down |
260 | * all the host resources created to handle communication with | 260 | * all the host resources created to handle communication with |
261 | * the device. | 261 | * the device. |
262 | * | 262 | * |
263 | * @bus_tx_kick: [fill] Function called by the bus-generic code to let | 263 | * @bus_tx_kick: [fill] Function called by the bus-generic code to let |