From 88fcd5627563722483427a55113c0a83f56e8080 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Mon, 7 Apr 2008 22:47:22 +0900 Subject: libata: make PMP support optional Make PMP support optional by adding CONFIG_SATA_PMP and leaving out libata-pmp.c if it isn't set. PMP helpers return constant values if PMP support is not enabled and PMP declarations alias non-PMP counterparts. This makes the compiler to leave out PMP related part out and LLDs to use non-PMP counterparts automatically. Signed-off-by: Tejun Heo --- drivers/ata/Kconfig | 6 ++++++ drivers/ata/Makefile | 3 ++- drivers/ata/libata.h | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index 48c8fc55391e..3eb6035b61b8 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig @@ -41,6 +41,12 @@ config ATA_ACPI You can disable this at kernel boot time by using the option libata.noacpi=1 +config SATA_PMP + bool "SATA Port Multiplier support" + default y + help + This option adds support for SATA Port Multipliers. + config SATA_AHCI tristate "AHCI SATA support" depends on PCI diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile index e6e41b2c731c..1fbc2aa648b7 100644 --- a/drivers/ata/Makefile +++ b/drivers/ata/Makefile @@ -78,6 +78,7 @@ obj-$(CONFIG_ATA_GENERIC) += ata_generic.o # Should be last libata driver obj-$(CONFIG_PATA_LEGACY) += pata_legacy.o -libata-objs := libata-core.o libata-scsi.o libata-eh.o libata-pmp.o +libata-objs := libata-core.o libata-scsi.o libata-eh.o libata-$(CONFIG_ATA_SFF) += libata-sff.o +libata-$(CONFIG_SATA_PMP) += libata-pmp.o libata-$(CONFIG_ATA_ACPI) += libata-acpi.o diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index 42b30e38495d..4aeeabb10a47 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h @@ -203,9 +203,26 @@ extern int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset, extern void ata_eh_finish(struct ata_port *ap); /* libata-pmp.c */ +#ifdef CONFIG_SATA_PMP extern int sata_pmp_scr_read(struct ata_link *link, int reg, u32 *val); extern int sata_pmp_scr_write(struct ata_link *link, int reg, u32 val); extern int sata_pmp_attach(struct ata_device *dev); +#else /* CONFIG_SATA_PMP */ +static inline int sata_pmp_scr_read(struct ata_link *link, int reg, u32 *val) +{ + return -EINVAL; +} + +static inline int sata_pmp_scr_write(struct ata_link *link, int reg, u32 val) +{ + return -EINVAL; +} + +static inline int sata_pmp_attach(struct ata_device *dev) +{ + return -EINVAL; +} +#endif /* CONFIG_SATA_PMP */ /* libata-sff.c */ #ifdef CONFIG_ATA_SFF -- cgit v1.2.3