aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_qstor.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-07-16 01:29:40 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-20 08:02:11 -0400
commitda3dbb17a0e9a9ec7f5aed95f1fddadb790edc9d (patch)
tree289239e1eb60168321e905c545aa2e2f3a2b5475 /drivers/ata/sata_qstor.c
parent5335b729064e03319cd2d5219770451dbb1d7f67 (diff)
libata: make ->scr_read/write callbacks return error code
Convert ->scr_read/write callbacks to return error code to better indicate failure. This will help handling of SCR_NOTIFICATION. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/sata_qstor.c')
-rw-r--r--drivers/ata/sata_qstor.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c
index 5aef4ac37012..c8f9242e7f44 100644
--- a/drivers/ata/sata_qstor.c
+++ b/drivers/ata/sata_qstor.c
@@ -111,8 +111,8 @@ struct qs_port_priv {
111 qs_state_t state; 111 qs_state_t state;
112}; 112};
113 113
114static u32 qs_scr_read (struct ata_port *ap, unsigned int sc_reg); 114static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val);
115static void qs_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); 115static int qs_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val);
116static int qs_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); 116static int qs_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
117static int qs_port_start(struct ata_port *ap); 117static int qs_port_start(struct ata_port *ap);
118static void qs_host_stop(struct ata_host *host); 118static void qs_host_stop(struct ata_host *host);
@@ -255,18 +255,20 @@ static void qs_eng_timeout(struct ata_port *ap)
255 ata_eng_timeout(ap); 255 ata_eng_timeout(ap);
256} 256}
257 257
258static u32 qs_scr_read (struct ata_port *ap, unsigned int sc_reg) 258static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
259{ 259{
260 if (sc_reg > SCR_CONTROL) 260 if (sc_reg > SCR_CONTROL)
261 return ~0U; 261 return -EINVAL;
262 return readl(ap->ioaddr.scr_addr + (sc_reg * 8)); 262 *val = readl(ap->ioaddr.scr_addr + (sc_reg * 8));
263 return 0;
263} 264}
264 265
265static void qs_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) 266static int qs_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val)
266{ 267{
267 if (sc_reg > SCR_CONTROL) 268 if (sc_reg > SCR_CONTROL)
268 return; 269 return -EINVAL;
269 writel(val, ap->ioaddr.scr_addr + (sc_reg * 8)); 270 writel(val, ap->ioaddr.scr_addr + (sc_reg * 8));
271 return 0;
270} 272}
271 273
272static unsigned int qs_fill_sg(struct ata_queued_cmd *qc) 274static unsigned int qs_fill_sg(struct ata_queued_cmd *qc)