libata: make SFF support optional
Now that SFF support is completely separated out from the core layer,
it can be made optional. Add CONFIG_ATA_SFF and let SFF drivers
depend on it. If CONFIG_ATA_SFF isn't set, all codes in libata-sff.c
and data structures for SFF support are disabled. This saves good
number of bytes for small systems.
Signed-off-by: Tejun Heo <htejun@gmail.com>
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 87f54a1..6b70a62 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -42,8 +42,10 @@
{
if (reset == sata_std_hardreset)
return 1;
+#ifdef CONFIG_ATA_SFF
if (reset == sata_sff_hardreset)
return 1;
+#endif
return 0;
}
@@ -206,9 +208,11 @@
extern void ata_eh_finish(struct ata_port *ap);
/* libata-sff.c */
+#ifdef CONFIG_ATA_SFF
extern void ata_dev_select(struct ata_port *ap, unsigned int device,
unsigned int wait, unsigned int can_sleep);
extern u8 ata_irq_on(struct ata_port *ap);
extern void ata_pio_task(struct work_struct *work);
+#endif /* CONFIG_ATA_SFF */
#endif /* __LIBATA_H__ */