[PATCH 07/15] libata: implement ata_port_max_devices()

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

 



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@xxxxxxxxx>

---

 include/linux/libata.h |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

af0dd1d6c6651ab9e8e3a9d8e7264daf57eff032
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 20b1cf5..3afd009 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -887,6 +887,9 @@ static inline unsigned int ata_tag_inter
 	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;
@@ -917,6 +920,17 @@ static inline unsigned int ata_dev_absen
 	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);
-- 
1.3.2


-
: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux