@@ -366,11 +366,8 @@ static CcwDevice *s390_get_ccw_device(DeviceState *dev_st, int *devtype)
ccw_dev = CCW_DEVICE(vfio_ccw_dev);
tmp_dt = CCW_DEVTYPE_VFIO;
} else {
- SCSIDevice *sd = (SCSIDevice *)
- object_dynamic_cast(OBJECT(dev_st),
- TYPE_SCSI_DEVICE);
- if (sd) {
- SCSIBus *sbus = scsi_bus_from_device(sd);
+ if (object_dynamic_cast(OBJECT(dev_st), TYPE_SCSI_DEVICE)) {
+ SCSIBus *sbus = SCSI_BUS(qdev_get_parent_bus(dev_st));
VirtIODevice *vdev = (VirtIODevice *)
object_dynamic_cast(OBJECT(sbus->qbus.parent),
TYPE_VIRTIO_DEVICE);
@@ -679,7 +679,7 @@ SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d,
uint32_t tag, uint32_t lun, void *hba_private)
{
SCSIRequest *req;
- SCSIBus *bus = scsi_bus_from_device(d);
+ SCSIBus *bus = SCSI_BUS(qdev_get_parent_bus(DEVICE(d)));
BusState *qbus = BUS(bus);
const int memset_off = offsetof(SCSIRequest, sense)
+ sizeof(req->sense);
@@ -175,11 +175,6 @@ static inline void scsi_bus_init(SCSIBus *bus, size_t bus_size,
scsi_bus_init_named(bus, bus_size, host, info, NULL);
}
-static inline SCSIBus *scsi_bus_from_device(SCSIDevice *d)
-{
- return SCSI_BUS(qdev_get_parent_bus(DEVICE(d)));
-}
-
SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk,
int unit, bool removable, int bootindex,
bool share_rw,