aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_nv.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_nv.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_nv.c')
-rw-r--r--drivers/ata/sata_nv.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 5d943da042f7..0b58c4df6fd2 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -236,8 +236,8 @@ static void nv_ck804_host_stop(struct ata_host *host);
236static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance); 236static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance);
237static irqreturn_t nv_nf2_interrupt(int irq, void *dev_instance); 237static irqreturn_t nv_nf2_interrupt(int irq, void *dev_instance);
238static irqreturn_t nv_ck804_interrupt(int irq, void *dev_instance); 238static irqreturn_t nv_ck804_interrupt(int irq, void *dev_instance);
239static u32 nv_scr_read (struct ata_port *ap, unsigned int sc_reg); 239static int nv_scr_read (struct ata_port *ap, unsigned int sc_reg, u32 *val);
240static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); 240static int nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
241 241
242static void nv_nf2_freeze(struct ata_port *ap); 242static void nv_nf2_freeze(struct ata_port *ap);
243static void nv_nf2_thaw(struct ata_port *ap); 243static void nv_nf2_thaw(struct ata_port *ap);
@@ -1393,20 +1393,22 @@ static irqreturn_t nv_ck804_interrupt(int irq, void *dev_instance)
1393 return ret; 1393 return ret;
1394} 1394}
1395 1395
1396static u32 nv_scr_read (struct ata_port *ap, unsigned int sc_reg) 1396static int nv_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
1397{ 1397{
1398 if (sc_reg > SCR_CONTROL) 1398 if (sc_reg > SCR_CONTROL)
1399 return 0xffffffffU; 1399 return -EINVAL;
1400 1400
1401 return ioread32(ap->ioaddr.scr_addr + (sc_reg * 4)); 1401 *val = ioread32(ap->ioaddr.scr_addr + (sc_reg * 4));
1402 return 0;
1402} 1403}
1403 1404
1404static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) 1405static int nv_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val)
1405{ 1406{
1406 if (sc_reg > SCR_CONTROL) 1407 if (sc_reg > SCR_CONTROL)
1407 return; 1408 return -EINVAL;
1408 1409
1409 iowrite32(val, ap->ioaddr.scr_addr + (sc_reg * 4)); 1410 iowrite32(val, ap->ioaddr.scr_addr + (sc_reg * 4));
1411 return 0;
1410} 1412}
1411 1413
1412static void nv_nf2_freeze(struct ata_port *ap) 1414static void nv_nf2_freeze(struct ata_port *ap)