diff options
author | Tejun Heo <htejun@gmail.com> | 2007-07-16 01:29:40 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-20 08:02:11 -0400 |
commit | da3dbb17a0e9a9ec7f5aed95f1fddadb790edc9d (patch) | |
tree | 289239e1eb60168321e905c545aa2e2f3a2b5475 /drivers/ata/sata_uli.c | |
parent | 5335b729064e03319cd2d5219770451dbb1d7f67 (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_uli.c')
-rw-r--r-- | drivers/ata/sata_uli.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/ata/sata_uli.c b/drivers/ata/sata_uli.c index b52f83ab056a..78c28512f01c 100644 --- a/drivers/ata/sata_uli.c +++ b/drivers/ata/sata_uli.c | |||
@@ -57,8 +57,8 @@ struct uli_priv { | |||
57 | }; | 57 | }; |
58 | 58 | ||
59 | static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); | 59 | static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); |
60 | static u32 uli_scr_read (struct ata_port *ap, unsigned int sc_reg); | 60 | static int uli_scr_read (struct ata_port *ap, unsigned int sc_reg, u32 *val); |
61 | static void uli_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); | 61 | static int uli_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); |
62 | 62 | ||
63 | static const struct pci_device_id uli_pci_tbl[] = { | 63 | static const struct pci_device_id uli_pci_tbl[] = { |
64 | { PCI_VDEVICE(AL, 0x5289), uli_5289 }, | 64 | { PCI_VDEVICE(AL, 0x5289), uli_5289 }, |
@@ -164,20 +164,22 @@ static void uli_scr_cfg_write (struct ata_port *ap, unsigned int scr, u32 val) | |||
164 | pci_write_config_dword(pdev, cfg_addr, val); | 164 | pci_write_config_dword(pdev, cfg_addr, val); |
165 | } | 165 | } |
166 | 166 | ||
167 | static u32 uli_scr_read (struct ata_port *ap, unsigned int sc_reg) | 167 | static int uli_scr_read (struct ata_port *ap, unsigned int sc_reg, u32 *val) |
168 | { | 168 | { |
169 | if (sc_reg > SCR_CONTROL) | 169 | if (sc_reg > SCR_CONTROL) |
170 | return 0xffffffffU; | 170 | return -EINVAL; |
171 | 171 | ||
172 | return uli_scr_cfg_read(ap, sc_reg); | 172 | *val = uli_scr_cfg_read(ap, sc_reg); |
173 | return 0; | ||
173 | } | 174 | } |
174 | 175 | ||
175 | static void uli_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) | 176 | static int uli_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) |
176 | { | 177 | { |
177 | if (sc_reg > SCR_CONTROL) //SCR_CONTROL=2, SCR_ERROR=1, SCR_STATUS=0 | 178 | if (sc_reg > SCR_CONTROL) //SCR_CONTROL=2, SCR_ERROR=1, SCR_STATUS=0 |
178 | return; | 179 | return -EINVAL; |
179 | 180 | ||
180 | uli_scr_cfg_write(ap, sc_reg, val); | 181 | uli_scr_cfg_write(ap, sc_reg, val); |
182 | return 0; | ||
181 | } | 183 | } |
182 | 184 | ||
183 | static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | 185 | static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) |