mirror of
https://github.com/torvalds/linux.git
synced 2024-11-16 09:02:00 +00:00
lcs: Return zero from ccwgroup devs set_offline function
A return code of non-zero of the devs ccwgroup set_offline function leaves the dev in online state. Having done a partly offlining may leave the dev in unusable state. To make sure the dev is set to offline, zero is returned. A setup trace entry is written in case the offlining steps encountered some trouble. Signed-off-by: Klaus-Dieter Wacker <kdwacker@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e0a8114c03
commit
e427babeef
@ -2240,7 +2240,7 @@ __lcs_shutdown_device(struct ccwgroup_device *ccwgdev, int recovery_mode)
|
|||||||
{
|
{
|
||||||
struct lcs_card *card;
|
struct lcs_card *card;
|
||||||
enum lcs_dev_states recover_state;
|
enum lcs_dev_states recover_state;
|
||||||
int ret;
|
int ret = 0, ret2 = 0, ret3 = 0;
|
||||||
|
|
||||||
LCS_DBF_TEXT(3, setup, "shtdndev");
|
LCS_DBF_TEXT(3, setup, "shtdndev");
|
||||||
card = dev_get_drvdata(&ccwgdev->dev);
|
card = dev_get_drvdata(&ccwgdev->dev);
|
||||||
@ -2255,13 +2255,15 @@ __lcs_shutdown_device(struct ccwgroup_device *ccwgdev, int recovery_mode)
|
|||||||
recover_state = card->state;
|
recover_state = card->state;
|
||||||
|
|
||||||
ret = lcs_stop_device(card->dev);
|
ret = lcs_stop_device(card->dev);
|
||||||
ret = ccw_device_set_offline(card->read.ccwdev);
|
ret2 = ccw_device_set_offline(card->read.ccwdev);
|
||||||
ret = ccw_device_set_offline(card->write.ccwdev);
|
ret3 = ccw_device_set_offline(card->write.ccwdev);
|
||||||
|
if (!ret)
|
||||||
|
ret = (ret2) ? ret2 : ret3;
|
||||||
|
if (ret)
|
||||||
|
LCS_DBF_TEXT_(3, setup, "1err:%d", ret);
|
||||||
if (recover_state == DEV_STATE_UP) {
|
if (recover_state == DEV_STATE_UP) {
|
||||||
card->state = DEV_STATE_RECOVER;
|
card->state = DEV_STATE_RECOVER;
|
||||||
}
|
}
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user