NFC: nci: Add NCI_RESET return code check before setup

setup was executed in any case, even if NCI_RESET failed.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Christophe Ricard 2015-06-06 13:16:39 +02:00 коммит произвёл Samuel Ortiz
Родитель b6355e972a
Коммит 81859ab877
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -347,8 +347,9 @@ static int nci_open_device(struct nci_dev *ndev)
rc = __nci_request(ndev, nci_reset_req, 0,
msecs_to_jiffies(NCI_RESET_TIMEOUT));
if (ndev->ops->setup)
ndev->ops->setup(ndev);
if (!rc && ndev->ops->setup) {
rc = ndev->ops->setup(ndev);
}
if (!rc) {
rc = __nci_request(ndev, nci_init_req, 0,