summaryrefslogtreecommitdiff
path: root/drivers/scsi/st.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2016-01-06 17:31:06 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-01-06 17:31:06 -0800
commitefbc57c0e6a92083fce03927736f5d389182935b (patch)
tree2e900ae80abfd296a6f0c0c3a7e6c1ae95ae2705 /drivers/scsi/st.c
parent4b1af853646ca893fa686701d1605998fffcc82c (diff)
parent57c80e8e5d1cddae0651e5314394e6069ebbbe3c (diff)
Merge branch 'goodix' into next
Merge several improvements to Goodix touchscreen driver: - power management support - configuration upload - axis swapping and inversion
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r--drivers/scsi/st.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index e0a1e52a04e7..2e522951b619 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -4083,6 +4083,7 @@ static int create_one_cdev(struct scsi_tape *tape, int mode, int rew)
}
cdev->owner = THIS_MODULE;
cdev->ops = &st_fops;
+ STm->cdevs[rew] = cdev;
error = cdev_add(cdev, cdev_devno, 1);
if (error) {
@@ -4091,7 +4092,6 @@ static int create_one_cdev(struct scsi_tape *tape, int mode, int rew)
pr_err("st%d: Device not attached.\n", dev_num);
goto out_free;
}
- STm->cdevs[rew] = cdev;
i = mode << (4 - ST_NBR_MODE_BITS);
snprintf(name, 10, "%s%s%s", rew ? "n" : "",
@@ -4110,8 +4110,9 @@ static int create_one_cdev(struct scsi_tape *tape, int mode, int rew)
return 0;
out_free:
cdev_del(STm->cdevs[rew]);
- STm->cdevs[rew] = NULL;
out:
+ STm->cdevs[rew] = NULL;
+ STm->devs[rew] = NULL;
return error;
}