···338 */339void wimax_state_change(struct wimax_dev *wimax_dev, enum wimax_st new_state)340{341+ /*342+ * A driver cannot take the wimax_dev out of the343+ * __WIMAX_ST_NULL state unless by calling wimax_dev_add(). If344+ * the wimax_dev's state is still NULL, we ignore any request345+ * to change its state because it means it hasn't been yet346+ * registered.347+ *348+ * There is no need to complain about it, as routines that349+ * call this might be shared from different code paths that350+ * are called before or after wimax_dev_add() has done its351+ * job.352+ */353 mutex_lock(&wimax_dev->mutex);354+ if (wimax_dev->state > __WIMAX_ST_NULL)355+ __wimax_state_change(wimax_dev, new_state);356 mutex_unlock(&wimax_dev->mutex);357 return;358}···376void wimax_dev_init(struct wimax_dev *wimax_dev)377{378 INIT_LIST_HEAD(&wimax_dev->id_table_node);379+ __wimax_state_set(wimax_dev, __WIMAX_ST_NULL);380 mutex_init(&wimax_dev->mutex);381 mutex_init(&wimax_dev->mutex_reset);382}