Lines Matching refs:starget

1351 static int scsi_target_add(struct scsi_target *starget)  in scsi_target_add()  argument
1355 if (starget->state != STARGET_CREATED) in scsi_target_add()
1358 error = device_add(&starget->dev); in scsi_target_add()
1360 dev_err(&starget->dev, "target device_add failed, error %d\n", error); in scsi_target_add()
1363 transport_add_device(&starget->dev); in scsi_target_add()
1364 starget->state = STARGET_RUNNING; in scsi_target_add()
1366 pm_runtime_set_active(&starget->dev); in scsi_target_add()
1367 pm_runtime_enable(&starget->dev); in scsi_target_add()
1368 device_enable_async_suspend(&starget->dev); in scsi_target_add()
1383 struct scsi_target *starget = sdev->sdev_target; in scsi_sysfs_add_sdev() local
1385 error = scsi_target_add(starget); in scsi_sysfs_add_sdev()
1389 transport_configure_device(&starget->dev); in scsi_sysfs_add_sdev()
1392 scsi_autopm_get_target(starget); in scsi_sysfs_add_sdev()
1397 scsi_autopm_put_target(starget); in scsi_sysfs_add_sdev()
1520 static void __scsi_remove_target(struct scsi_target *starget) in __scsi_remove_target() argument
1522 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in __scsi_remove_target()
1535 if (sdev->channel != starget->channel || in __scsi_remove_target()
1536 sdev->id != starget->id) in __scsi_remove_target()
1562 struct scsi_target *starget; in scsi_remove_target() local
1567 list_for_each_entry(starget, &shost->__targets, siblings) { in scsi_remove_target()
1568 if (starget->state == STARGET_DEL || in scsi_remove_target()
1569 starget->state == STARGET_REMOVE || in scsi_remove_target()
1570 starget->state == STARGET_CREATED_REMOVE) in scsi_remove_target()
1572 if (starget->dev.parent == dev || &starget->dev == dev) { in scsi_remove_target()
1573 kref_get(&starget->reap_ref); in scsi_remove_target()
1574 if (starget->state == STARGET_CREATED) in scsi_remove_target()
1575 starget->state = STARGET_CREATED_REMOVE; in scsi_remove_target()
1577 starget->state = STARGET_REMOVE; in scsi_remove_target()
1579 __scsi_remove_target(starget); in scsi_remove_target()
1580 scsi_target_reap(starget); in scsi_remove_target()
1626 struct scsi_target *starget = sdev->sdev_target; in scsi_sysfs_device_initialize() local
1648 sdev->scsi_level = starget->scsi_level; in scsi_sysfs_device_initialize()
1656 list_add_tail(&sdev->same_target_siblings, &starget->devices); in scsi_sysfs_device_initialize()
1664 kref_get(&starget->reap_ref); in scsi_sysfs_device_initialize()