mirror of https://gitee.com/openkylin/linux.git
lcs: Recognize return codes of ccw_device_set_online().
The creation of a new lcs device requires a call to the function ccw_device_set_online() for the read and the write channel. Failure of either call should terminate the lcs device creation immediately with return code -ENODEV. Signed-off-by: Klaus-Dieter Wacker <kdwacker@de.ibm.com> Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d62e09e34e
commit
d816d42382
|
@ -2130,8 +2130,12 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
|
||||||
card->write.ccwdev = ccwgdev->cdev[1];
|
card->write.ccwdev = ccwgdev->cdev[1];
|
||||||
|
|
||||||
recover_state = card->state;
|
recover_state = card->state;
|
||||||
ccw_device_set_online(card->read.ccwdev);
|
rc = ccw_device_set_online(card->read.ccwdev);
|
||||||
ccw_device_set_online(card->write.ccwdev);
|
if (rc)
|
||||||
|
goto out_err;
|
||||||
|
rc = ccw_device_set_online(card->write.ccwdev);
|
||||||
|
if (rc)
|
||||||
|
goto out_werr;
|
||||||
|
|
||||||
LCS_DBF_TEXT(3, setup, "lcsnewdv");
|
LCS_DBF_TEXT(3, setup, "lcsnewdv");
|
||||||
|
|
||||||
|
@ -2210,8 +2214,10 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
|
||||||
return 0;
|
return 0;
|
||||||
out:
|
out:
|
||||||
|
|
||||||
ccw_device_set_offline(card->read.ccwdev);
|
|
||||||
ccw_device_set_offline(card->write.ccwdev);
|
ccw_device_set_offline(card->write.ccwdev);
|
||||||
|
out_werr:
|
||||||
|
ccw_device_set_offline(card->read.ccwdev);
|
||||||
|
out_err:
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue