Commit b5b3fa38 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

libata: misc updates to prepare for slave link

* Add ATA_EH_ALL_ACTIONS.

* Make sata_link_{on|off}_line() return bool instead of int.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent aadffb68
...@@ -4976,16 +4976,16 @@ int sata_scr_write_flush(struct ata_link *link, int reg, u32 val) ...@@ -4976,16 +4976,16 @@ int sata_scr_write_flush(struct ata_link *link, int reg, u32 val)
* None. * None.
* *
* RETURNS: * RETURNS:
* 1 if the port online status is available and online. * True if the port online status is available and online.
*/ */
int ata_link_online(struct ata_link *link) bool ata_link_online(struct ata_link *link)
{ {
u32 sstatus; u32 sstatus;
if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0 && if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0 &&
(sstatus & 0xf) == 0x3) (sstatus & 0xf) == 0x3)
return 1; return true;
return 0; return false;
} }
/** /**
...@@ -5000,16 +5000,16 @@ int ata_link_online(struct ata_link *link) ...@@ -5000,16 +5000,16 @@ int ata_link_online(struct ata_link *link)
* None. * None.
* *
* RETURNS: * RETURNS:
* 1 if the port offline status is available and offline. * True if the port offline status is available and offline.
*/ */
int ata_link_offline(struct ata_link *link) bool ata_link_offline(struct ata_link *link)
{ {
u32 sstatus; u32 sstatus;
if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0 && if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0 &&
(sstatus & 0xf) != 0x3) (sstatus & 0xf) != 0x3)
return 1; return true;
return 0; return false;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -321,6 +321,8 @@ enum { ...@@ -321,6 +321,8 @@ enum {
ATA_EH_LPM = (1 << 4), /* link power management action */ ATA_EH_LPM = (1 << 4), /* link power management action */
ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE, ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE,
ATA_EH_ALL_ACTIONS = ATA_EH_REVALIDATE | ATA_EH_RESET |
ATA_EH_ENABLE_LINK | ATA_EH_LPM,
/* ata_eh_info->flags */ /* ata_eh_info->flags */
ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */
...@@ -920,8 +922,8 @@ extern int sata_scr_valid(struct ata_link *link); ...@@ -920,8 +922,8 @@ extern int sata_scr_valid(struct ata_link *link);
extern int sata_scr_read(struct ata_link *link, int reg, u32 *val); extern int sata_scr_read(struct ata_link *link, int reg, u32 *val);
extern int sata_scr_write(struct ata_link *link, int reg, u32 val); extern int sata_scr_write(struct ata_link *link, int reg, u32 val);
extern int sata_scr_write_flush(struct ata_link *link, int reg, u32 val); extern int sata_scr_write_flush(struct ata_link *link, int reg, u32 val);
extern int ata_link_online(struct ata_link *link); extern bool ata_link_online(struct ata_link *link);
extern int ata_link_offline(struct ata_link *link); extern bool ata_link_offline(struct ata_link *link);
#ifdef CONFIG_PM #ifdef CONFIG_PM
extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg);
extern void ata_host_resume(struct ata_host *host); extern void ata_host_resume(struct ata_host *host);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment