ata: libata-scsi: Cleanup ata_scsi_offline_dev()
Change the function ata_scsi_offline_dev() to return a bool and change this function kdoc comment to have the correct mention of its call site. No functional changes. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Niklas Cassel <cassel@kernel.org>pull/1309/head
parent
a0f26fcc38
commit
cb45e3ff43
|
|
@ -4633,24 +4633,23 @@ void ata_scsi_scan_host(struct ata_port *ap, int sync)
|
||||||
* ata_scsi_offline_dev - offline attached SCSI device
|
* ata_scsi_offline_dev - offline attached SCSI device
|
||||||
* @dev: ATA device to offline attached SCSI device for
|
* @dev: ATA device to offline attached SCSI device for
|
||||||
*
|
*
|
||||||
* This function is called from ata_eh_hotplug() and responsible
|
* This function is called from ata_eh_detach_dev() and is responsible for
|
||||||
* for taking the SCSI device attached to @dev offline. This
|
* taking the SCSI device attached to @dev offline. This function is
|
||||||
* function is called with host lock which protects dev->sdev
|
* called with host lock which protects dev->sdev against clearing.
|
||||||
* against clearing.
|
|
||||||
*
|
*
|
||||||
* LOCKING:
|
* LOCKING:
|
||||||
* spin_lock_irqsave(host lock)
|
* spin_lock_irqsave(host lock)
|
||||||
*
|
*
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
* 1 if attached SCSI device exists, 0 otherwise.
|
* true if attached SCSI device exists, false otherwise.
|
||||||
*/
|
*/
|
||||||
int ata_scsi_offline_dev(struct ata_device *dev)
|
bool ata_scsi_offline_dev(struct ata_device *dev)
|
||||||
{
|
{
|
||||||
if (dev->sdev) {
|
if (dev->sdev) {
|
||||||
scsi_device_set_state(dev->sdev, SDEV_OFFLINE);
|
scsi_device_set_state(dev->sdev, SDEV_OFFLINE);
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ extern struct ata_device *ata_scsi_find_dev(struct ata_port *ap,
|
||||||
extern int ata_scsi_add_hosts(struct ata_host *host,
|
extern int ata_scsi_add_hosts(struct ata_host *host,
|
||||||
const struct scsi_host_template *sht);
|
const struct scsi_host_template *sht);
|
||||||
extern void ata_scsi_scan_host(struct ata_port *ap, int sync);
|
extern void ata_scsi_scan_host(struct ata_port *ap, int sync);
|
||||||
extern int ata_scsi_offline_dev(struct ata_device *dev);
|
extern bool ata_scsi_offline_dev(struct ata_device *dev);
|
||||||
extern bool ata_scsi_sense_is_valid(u8 sk, u8 asc, u8 ascq);
|
extern bool ata_scsi_sense_is_valid(u8 sk, u8 asc, u8 ascq);
|
||||||
extern void ata_scsi_set_sense(struct ata_device *dev,
|
extern void ata_scsi_set_sense(struct ata_device *dev,
|
||||||
struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq);
|
struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue