提交 5806db22 编写于 作者: T Tejun Heo 提交者: Jeff Garzik

[PATCH] libata: implement ata_port_max_devices()

Implement ata_port_max_devices().  This function returns the number of
possible devices on a port.  This will be used by new PM
implementation.
Signed-off-by: NTejun Heo <htejun@gmail.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 77b08fb5
...@@ -888,6 +888,9 @@ static inline unsigned int ata_tag_internal(unsigned int tag) ...@@ -888,6 +888,9 @@ static inline unsigned int ata_tag_internal(unsigned int tag)
return tag == ATA_MAX_QUEUE - 1; return tag == ATA_MAX_QUEUE - 1;
} }
/*
* device helpers
*/
static inline unsigned int ata_class_enabled(unsigned int class) static inline unsigned int ata_class_enabled(unsigned int class)
{ {
return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI;
...@@ -918,6 +921,17 @@ static inline unsigned int ata_dev_absent(const struct ata_device *dev) ...@@ -918,6 +921,17 @@ static inline unsigned int ata_dev_absent(const struct ata_device *dev)
return ata_class_absent(dev->class); return ata_class_absent(dev->class);
} }
/*
* port helpers
*/
static inline int ata_port_max_devices(const struct ata_port *ap)
{
if (ap->flags & ATA_FLAG_SLAVE_POSS)
return 2;
return 1;
}
static inline u8 ata_chk_status(struct ata_port *ap) static inline u8 ata_chk_status(struct ata_port *ap)
{ {
return ap->ops->check_status(ap); return ap->ops->check_status(ap);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册