diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2007-03-20 13:26:03 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-03-20 13:44:52 -0400 |
commit | cc5d2c8c64804564617a7be71c73a075a426d1c6 (patch) | |
tree | 4c5768222bc4f0133d1b45180a36e234f8b5cc0c /drivers | |
parent | c3c94c5a2fb43a654e777f509d5032b0db8ed09f (diff) |
[SCSI] sd: fix up start/stop messages for new sd_printk() API
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/sd.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 49a94ae3225b..b044dcf73427 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -1733,10 +1733,11 @@ static void scsi_disk_release(struct class_device *cdev) | |||
1733 | kfree(sdkp); | 1733 | kfree(sdkp); |
1734 | } | 1734 | } |
1735 | 1735 | ||
1736 | static int sd_start_stop_device(struct scsi_device *sdp, int start) | 1736 | static int sd_start_stop_device(struct scsi_disk *sdkp, int start) |
1737 | { | 1737 | { |
1738 | unsigned char cmd[6] = { START_STOP }; /* START_VALID */ | 1738 | unsigned char cmd[6] = { START_STOP }; /* START_VALID */ |
1739 | struct scsi_sense_hdr sshdr; | 1739 | struct scsi_sense_hdr sshdr; |
1740 | struct scsi_device *sdp = sdkp->device; | ||
1740 | int res; | 1741 | int res; |
1741 | 1742 | ||
1742 | if (start) | 1743 | if (start) |
@@ -1748,12 +1749,10 @@ static int sd_start_stop_device(struct scsi_device *sdp, int start) | |||
1748 | res = scsi_execute_req(sdp, cmd, DMA_NONE, NULL, 0, &sshdr, | 1749 | res = scsi_execute_req(sdp, cmd, DMA_NONE, NULL, 0, &sshdr, |
1749 | SD_TIMEOUT, SD_MAX_RETRIES); | 1750 | SD_TIMEOUT, SD_MAX_RETRIES); |
1750 | if (res) { | 1751 | if (res) { |
1751 | printk(KERN_WARNING "FAILED\n status = %x, message = %02x, " | 1752 | sd_printk(KERN_WARNING, sdkp, "START_STOP FAILED\n"); |
1752 | "host = %d, driver = %02x\n ", | 1753 | sd_print_result(sdkp, res); |
1753 | status_byte(res), msg_byte(res), | ||
1754 | host_byte(res), driver_byte(res)); | ||
1755 | if (driver_byte(res) & DRIVER_SENSE) | 1754 | if (driver_byte(res) & DRIVER_SENSE) |
1756 | scsi_print_sense_hdr("sd", &sshdr); | 1755 | sd_print_sense_hdr(sdkp, &sshdr); |
1757 | } | 1756 | } |
1758 | 1757 | ||
1759 | return res; | 1758 | return res; |
@@ -1766,7 +1765,6 @@ static int sd_start_stop_device(struct scsi_device *sdp, int start) | |||
1766 | */ | 1765 | */ |
1767 | static void sd_shutdown(struct device *dev) | 1766 | static void sd_shutdown(struct device *dev) |
1768 | { | 1767 | { |
1769 | struct scsi_device *sdp = to_scsi_device(dev); | ||
1770 | struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev); | 1768 | struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev); |
1771 | 1769 | ||
1772 | if (!sdkp) | 1770 | if (!sdkp) |
@@ -1777,10 +1775,9 @@ static void sd_shutdown(struct device *dev) | |||
1777 | sd_sync_cache(sdkp); | 1775 | sd_sync_cache(sdkp); |
1778 | } | 1776 | } |
1779 | 1777 | ||
1780 | if (system_state != SYSTEM_RESTART && sdp->manage_start_stop) { | 1778 | if (system_state != SYSTEM_RESTART && sdkp->device->manage_start_stop) { |
1781 | printk(KERN_NOTICE "Stopping disk %s: \n", | 1779 | sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n"); |
1782 | sdkp->disk->disk_name); | 1780 | sd_start_stop_device(sdkp, 0); |
1783 | sd_start_stop_device(sdp, 0); | ||
1784 | } | 1781 | } |
1785 | 1782 | ||
1786 | scsi_disk_put(sdkp); | 1783 | scsi_disk_put(sdkp); |
@@ -1788,7 +1785,6 @@ static void sd_shutdown(struct device *dev) | |||
1788 | 1785 | ||
1789 | static int sd_suspend(struct device *dev, pm_message_t mesg) | 1786 | static int sd_suspend(struct device *dev, pm_message_t mesg) |
1790 | { | 1787 | { |
1791 | struct scsi_device *sdp = to_scsi_device(dev); | ||
1792 | struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev); | 1788 | struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev); |
1793 | int ret; | 1789 | int ret; |
1794 | 1790 | ||
@@ -1796,17 +1792,16 @@ static int sd_suspend(struct device *dev, pm_message_t mesg) | |||
1796 | return 0; /* this can happen */ | 1792 | return 0; /* this can happen */ |
1797 | 1793 | ||
1798 | if (sdkp->WCE) { | 1794 | if (sdkp->WCE) { |
1799 | printk(KERN_NOTICE "Synchronizing SCSI cache for disk %s: \n", | 1795 | sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n"); |
1800 | sdkp->disk->disk_name); | ||
1801 | ret = sd_sync_cache(sdkp); | 1796 | ret = sd_sync_cache(sdkp); |
1802 | if (ret) | 1797 | if (ret) |
1803 | return ret; | 1798 | return ret; |
1804 | } | 1799 | } |
1805 | 1800 | ||
1806 | if (mesg.event == PM_EVENT_SUSPEND && sdp->manage_start_stop) { | 1801 | if (mesg.event == PM_EVENT_SUSPEND && |
1807 | printk(KERN_NOTICE "Stopping disk %s: \n", | 1802 | sdkp->device->manage_start_stop) { |
1808 | sdkp->disk->disk_name); | 1803 | sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n"); |
1809 | ret = sd_start_stop_device(sdp, 0); | 1804 | ret = sd_start_stop_device(sdkp, 0); |
1810 | if (ret) | 1805 | if (ret) |
1811 | return ret; | 1806 | return ret; |
1812 | } | 1807 | } |
@@ -1816,15 +1811,14 @@ static int sd_suspend(struct device *dev, pm_message_t mesg) | |||
1816 | 1811 | ||
1817 | static int sd_resume(struct device *dev) | 1812 | static int sd_resume(struct device *dev) |
1818 | { | 1813 | { |
1819 | struct scsi_device *sdp = to_scsi_device(dev); | ||
1820 | struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev); | 1814 | struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev); |
1821 | 1815 | ||
1822 | if (!sdp->manage_start_stop) | 1816 | if (!sdkp->device->manage_start_stop) |
1823 | return 0; | 1817 | return 0; |
1824 | 1818 | ||
1825 | printk(KERN_NOTICE "Starting disk %s: \n", sdkp->disk->disk_name); | 1819 | sd_printk(KERN_NOTICE, sdkp, "Starting disk\n"); |
1826 | 1820 | ||
1827 | return sd_start_stop_device(sdp, 1); | 1821 | return sd_start_stop_device(sdkp, 1); |
1828 | } | 1822 | } |
1829 | 1823 | ||
1830 | /** | 1824 | /** |