diff options
author | Tejun Heo <htejun@gmail.com> | 2008-04-07 22:47:22 +0900 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:25 -0400 |
commit | 88fcd5627563722483427a55113c0a83f56e8080 (patch) | |
tree | 6a596e33d6497fbed58147e8fdb59b611d956c12 /drivers/ata/libata.h | |
parent | 071f44b1d2c051641b62a3571223314737ccbe59 (diff) | |
download | linux-88fcd5627563722483427a55113c0a83f56e8080.tar.gz linux-88fcd5627563722483427a55113c0a83f56e8080.tar.bz2 linux-88fcd5627563722483427a55113c0a83f56e8080.zip |
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 <htejun@gmail.com>
Diffstat (limited to 'drivers/ata/libata.h')
-rw-r--r-- | drivers/ata/libata.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 |