Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad160872 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller
Browse files

s390/qeth: simplify DOWN state handling



When the tear down sequence in qeth_l?_stop_card() has finished, the
card is guaranteed to be in DOWN state and we don't have to check for
it again.
With this insight we can also remove the redundant setting of
card->state in qeth_l?_set_online()'s error path.

Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4e2fe4ed
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -292,11 +292,9 @@ static void qeth_l2_stop_card(struct qeth_card *card)
		qeth_clear_working_pool_list(card);
		card->state = CARD_STATE_DOWN;
	}
	if (card->state == CARD_STATE_DOWN) {

	qeth_clear_cmd_buffers(&card->read);
	qeth_clear_cmd_buffers(&card->write);
	}

	flush_workqueue(card->event_wq);
	card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED;
}
@@ -882,7 +880,6 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev)
	ccw_device_set_offline(CARD_WDEV(card));
	ccw_device_set_offline(CARD_RDEV(card));
	qdio_free(CARD_DDEV(card));
	card->state = CARD_STATE_DOWN;

	mutex_unlock(&card->conf_mutex);
	mutex_unlock(&card->discipline_mutex);
+2 −5
Original line number Diff line number Diff line
@@ -1436,11 +1436,9 @@ static void qeth_l3_stop_card(struct qeth_card *card)
		qeth_clear_working_pool_list(card);
		card->state = CARD_STATE_DOWN;
	}
	if (card->state == CARD_STATE_DOWN) {

	qeth_clear_cmd_buffers(&card->read);
	qeth_clear_cmd_buffers(&card->write);
	}

	flush_workqueue(card->event_wq);
}

@@ -2420,7 +2418,6 @@ static int qeth_l3_set_online(struct ccwgroup_device *gdev)
	ccw_device_set_offline(CARD_WDEV(card));
	ccw_device_set_offline(CARD_RDEV(card));
	qdio_free(CARD_DDEV(card));
	card->state = CARD_STATE_DOWN;

	mutex_unlock(&card->conf_mutex);
	mutex_unlock(&card->discipline_mutex);