Re: [PATCH 12/13] ATA ACPI: use scsi_bus_shutdown for SATA/PATA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> From: Randy Dunlap <[email protected]>
> 
> Add ability for SCSI drivers to invoke a shutdown method.
> This allows drivers to make drives safe for shutdown/poweroff,
> for example.  Some drives need this to prevent possible problems.
> 
> Signed-off-by: Randy Dunlap <[email protected]>

> --- linux-2616-rc4-ata.orig/drivers/scsi/scsi_sysfs.c
> +++ linux-2616-rc4-ata/drivers/scsi/scsi_sysfs.c
> @@ -302,11 +302,27 @@ static int scsi_bus_resume(struct device
>  	return err;
>  }
>  
> +static void scsi_bus_shutdown(struct device * dev)
> +{
> +	struct scsi_device *sdev = to_scsi_device(dev);
> +	struct scsi_host_template *sht = sdev->host->hostt;
> +	int err;
> +
> +	err = scsi_device_quiesce(sdev);

int err = scsi_device_quiesce()?

> +	if (err)
> +		printk(KERN_DEBUG "%s: error (0x%x) during shutdown\n",
> +			__FUNCTION__, err);

If you get an error, and then ignore it... that should not be DEBUG
message, right?

> +	if (sht->shutdown)
> +		sht->shutdown(sdev);
> +}
> +
>  struct bus_type scsi_bus_type = {
>          .name		= "scsi",
>          .match		= scsi_bus_match,
>  	.suspend	= scsi_bus_suspend,
>  	.resume		= scsi_bus_resume,
> +	.shutdown	= scsi_bus_shutdown,
>  };

Whitespace?
								Pavel
-- 
Web maintainer for suspend.sf.net (www.sf.net/projects/suspend) wanted...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux