|
@@ -416,11 +416,13 @@ static void cx25840_initialize(struct i2c_client *client)
|
|
INIT_WORK(&state->fw_work, cx25840_work_handler);
|
|
INIT_WORK(&state->fw_work, cx25840_work_handler);
|
|
init_waitqueue_head(&state->fw_wait);
|
|
init_waitqueue_head(&state->fw_wait);
|
|
q = create_singlethread_workqueue("cx25840_fw");
|
|
q = create_singlethread_workqueue("cx25840_fw");
|
|
- prepare_to_wait(&state->fw_wait, &wait, TASK_UNINTERRUPTIBLE);
|
|
|
|
- queue_work(q, &state->fw_work);
|
|
|
|
- schedule();
|
|
|
|
- finish_wait(&state->fw_wait, &wait);
|
|
|
|
- destroy_workqueue(q);
|
|
|
|
|
|
+ if (q) {
|
|
|
|
+ prepare_to_wait(&state->fw_wait, &wait, TASK_UNINTERRUPTIBLE);
|
|
|
|
+ queue_work(q, &state->fw_work);
|
|
|
|
+ schedule();
|
|
|
|
+ finish_wait(&state->fw_wait, &wait);
|
|
|
|
+ destroy_workqueue(q);
|
|
|
|
+ }
|
|
|
|
|
|
/* 6. */
|
|
/* 6. */
|
|
cx25840_write(client, 0x115, 0x8c);
|
|
cx25840_write(client, 0x115, 0x8c);
|
|
@@ -630,11 +632,13 @@ static void cx23885_initialize(struct i2c_client *client)
|
|
INIT_WORK(&state->fw_work, cx25840_work_handler);
|
|
INIT_WORK(&state->fw_work, cx25840_work_handler);
|
|
init_waitqueue_head(&state->fw_wait);
|
|
init_waitqueue_head(&state->fw_wait);
|
|
q = create_singlethread_workqueue("cx25840_fw");
|
|
q = create_singlethread_workqueue("cx25840_fw");
|
|
- prepare_to_wait(&state->fw_wait, &wait, TASK_UNINTERRUPTIBLE);
|
|
|
|
- queue_work(q, &state->fw_work);
|
|
|
|
- schedule();
|
|
|
|
- finish_wait(&state->fw_wait, &wait);
|
|
|
|
- destroy_workqueue(q);
|
|
|
|
|
|
+ if (q) {
|
|
|
|
+ prepare_to_wait(&state->fw_wait, &wait, TASK_UNINTERRUPTIBLE);
|
|
|
|
+ queue_work(q, &state->fw_work);
|
|
|
|
+ schedule();
|
|
|
|
+ finish_wait(&state->fw_wait, &wait);
|
|
|
|
+ destroy_workqueue(q);
|
|
|
|
+ }
|
|
|
|
|
|
/* Call the cx23888 specific std setup func, we no longer rely on
|
|
/* Call the cx23888 specific std setup func, we no longer rely on
|
|
* the generic cx24840 func.
|
|
* the generic cx24840 func.
|
|
@@ -748,11 +752,13 @@ static void cx231xx_initialize(struct i2c_client *client)
|
|
INIT_WORK(&state->fw_work, cx25840_work_handler);
|
|
INIT_WORK(&state->fw_work, cx25840_work_handler);
|
|
init_waitqueue_head(&state->fw_wait);
|
|
init_waitqueue_head(&state->fw_wait);
|
|
q = create_singlethread_workqueue("cx25840_fw");
|
|
q = create_singlethread_workqueue("cx25840_fw");
|
|
- prepare_to_wait(&state->fw_wait, &wait, TASK_UNINTERRUPTIBLE);
|
|
|
|
- queue_work(q, &state->fw_work);
|
|
|
|
- schedule();
|
|
|
|
- finish_wait(&state->fw_wait, &wait);
|
|
|
|
- destroy_workqueue(q);
|
|
|
|
|
|
+ if (q) {
|
|
|
|
+ prepare_to_wait(&state->fw_wait, &wait, TASK_UNINTERRUPTIBLE);
|
|
|
|
+ queue_work(q, &state->fw_work);
|
|
|
|
+ schedule();
|
|
|
|
+ finish_wait(&state->fw_wait, &wait);
|
|
|
|
+ destroy_workqueue(q);
|
|
|
|
+ }
|
|
|
|
|
|
cx25840_std_setup(client);
|
|
cx25840_std_setup(client);
|
|
|
|
|