aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-01-20 02:00:28 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-09 17:39:37 -0500
commitf0d36efdc624beb3d9e29b9ab9e9537bf0f25d5b (patch)
treeeac4efb465aa682d6eaac61f76b3174ffd9fd8cd /include
parent0529c159dbdd79794796c1b50b39442d72efbe97 (diff)
libata: update libata core layer to use devres
Update libata core layer to use devres. * ata_device_add() acquires all resources in managed mode. * ata_host is allocated as devres associated with ata_host_release. * Port attached status is handled as devres associated with ata_host_attach_release(). * Initialization failure and host removal is handedl by releasing devres group. * Except for ata_scsi_release() removal, LLD interface remains the same. Some functions use hacky is_managed test to support both managed and unmanaged devices. These will go away once all LLDs are updated to use devres. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/libata.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index e9a0cfdcfe2c..f96277ed184f 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -31,7 +31,7 @@
31#include <linux/pci.h> 31#include <linux/pci.h>
32#include <linux/dma-mapping.h> 32#include <linux/dma-mapping.h>
33#include <asm/scatterlist.h> 33#include <asm/scatterlist.h>
34#include <asm/io.h> 34#include <linux/io.h>
35#include <linux/ata.h> 35#include <linux/ata.h>
36#include <linux/workqueue.h> 36#include <linux/workqueue.h>
37#include <scsi/scsi_host.h> 37#include <scsi/scsi_host.h>
@@ -726,7 +726,6 @@ extern void ata_host_remove(struct ata_host *host);
726extern int ata_scsi_detect(struct scsi_host_template *sht); 726extern int ata_scsi_detect(struct scsi_host_template *sht);
727extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 727extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
728extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); 728extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
729extern int ata_scsi_release(struct Scsi_Host *host);
730extern void ata_sas_port_destroy(struct ata_port *); 729extern void ata_sas_port_destroy(struct ata_port *);
731extern struct ata_port *ata_sas_port_alloc(struct ata_host *, 730extern struct ata_port *ata_sas_port_alloc(struct ata_host *,
732 struct ata_port_info *, struct Scsi_Host *); 731 struct ata_port_info *, struct Scsi_Host *);
@@ -1227,14 +1226,14 @@ static inline unsigned int __ac_err_mask(u8 status)
1227static inline int ata_pad_alloc(struct ata_port *ap, struct device *dev) 1226static inline int ata_pad_alloc(struct ata_port *ap, struct device *dev)
1228{ 1227{
1229 ap->pad_dma = 0; 1228 ap->pad_dma = 0;
1230 ap->pad = dma_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ, 1229 ap->pad = dmam_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ,
1231 &ap->pad_dma, GFP_KERNEL); 1230 &ap->pad_dma, GFP_KERNEL);
1232 return (ap->pad == NULL) ? -ENOMEM : 0; 1231 return (ap->pad == NULL) ? -ENOMEM : 0;
1233} 1232}
1234 1233
1235static inline void ata_pad_free(struct ata_port *ap, struct device *dev) 1234static inline void ata_pad_free(struct ata_port *ap, struct device *dev)
1236{ 1235{
1237 dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma); 1236 dmam_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
1238} 1237}
1239 1238
1240static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host) 1239static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host)