@@ -105,7 +105,6 @@ MODULE_ALIAS_SCSI_DEVICE(TYPE_ZBC);
static int sd_revalidate_disk(struct gendisk *);
static void sd_unlock_native_capacity(struct gendisk *disk);
-static void scsi_disk_release(struct device *cdev);
static DEFINE_IDA(sd_index_ida);
@@ -792,6 +791,17 @@ static struct attribute *sd_disk_attrs[] = {
};
ATTRIBUTE_GROUPS(sd_disk);
+static void scsi_disk_release(struct device *dev)
+{
+ struct scsi_disk *sdkp = to_scsi_disk(dev);
+
+ ida_free(&sd_index_ida, sdkp->index);
+ put_device(&sdkp->device->sdev_gendev);
+ free_opal_dev(sdkp->opal_dev);
+
+ kfree(sdkp);
+}
+
static struct class sd_disk_class = {
.name = "scsi_disk",
.dev_release = scsi_disk_release,
@@ -4037,17 +4047,6 @@ static int sd_probe(struct device *dev)
return error;
}
-static void scsi_disk_release(struct device *dev)
-{
- struct scsi_disk *sdkp = to_scsi_disk(dev);
-
- ida_free(&sd_index_ida, sdkp->index);
- put_device(&sdkp->device->sdev_gendev);
- free_opal_dev(sdkp->opal_dev);
-
- kfree(sdkp);
-}
-
static int sd_start_stop_device(struct scsi_disk *sdkp, int start)
{
unsigned char cmd[6] = { START_STOP }; /* START_VALID */