[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: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
diff --git a/include/linux/libata.h b/include/linux/libata.h
index c227dac..f4284bf 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -888,6 +888,9 @@
 	return tag == ATA_MAX_QUEUE - 1;
 }
 
+/*
+ * device helpers
+ */
 static inline unsigned int ata_class_enabled(unsigned int class)
 {
 	return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI;
@@ -918,6 +921,17 @@
 	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)
 {
 	return ap->ops->check_status(ap);