[SCSI] libsas: fix scr_read/write users and update the libata documentation

This fixes up the usage in libsas (which are easy to miss, since they're
only in the scsi-misc tree) ... and also corrects the documentation on
the point of what these two function pointers actually return.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by James Bottomley and committed by James Bottomley 110dd8f1 fbc9a572

+19 -10
+3 -2
Documentation/DocBook/libata.tmpl
··· 456 456 457 457 <sect2><title>SATA phy read/write</title> 458 458 <programlisting> 459 - u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); 460 - void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, 459 + int (*scr_read) (struct ata_port *ap, unsigned int sc_reg, 460 + u32 *val); 461 + int (*scr_write) (struct ata_port *ap, unsigned int sc_reg, 461 462 u32 val); 462 463 </programlisting> 463 464
+16 -8
drivers/scsi/libsas/sas_ata.c
··· 172 172 qc->tf.nsect = 0; 173 173 } 174 174 175 - ata_tf_to_fis(&qc->tf, (u8*)&task->ata_task.fis, 0); 175 + ata_tf_to_fis(&qc->tf, 1, 0, (u8*)&task->ata_task.fis); 176 176 task->uldd_task = qc; 177 177 if (is_atapi_taskfile(&qc->tf)) { 178 178 memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len); ··· 298 298 memcpy(tf, &dev->sata_dev.tf, sizeof (*tf)); 299 299 } 300 300 301 - static void sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in, 301 + static int sas_ata_scr_write(struct ata_port *ap, unsigned int sc_reg_in, 302 302 u32 val) 303 303 { 304 304 struct domain_device *dev = ap->private_data; ··· 317 317 case SCR_ACTIVE: 318 318 dev->sata_dev.ap->sactive = val; 319 319 break; 320 + default: 321 + return -EINVAL; 320 322 } 323 + return 0; 321 324 } 322 325 323 - static u32 sas_ata_scr_read(struct ata_port *ap, unsigned int sc_reg_in) 326 + static int sas_ata_scr_read(struct ata_port *ap, unsigned int sc_reg_in, 327 + u32 *val) 324 328 { 325 329 struct domain_device *dev = ap->private_data; 326 330 327 331 SAS_DPRINTK("STUB %s\n", __FUNCTION__); 328 332 switch (sc_reg_in) { 329 333 case SCR_STATUS: 330 - return dev->sata_dev.sstatus; 334 + *val = dev->sata_dev.sstatus; 335 + return 0; 331 336 case SCR_CONTROL: 332 - return dev->sata_dev.scontrol; 337 + *val = dev->sata_dev.scontrol; 338 + return 0; 333 339 case SCR_ERROR: 334 - return dev->sata_dev.serror; 340 + *val = dev->sata_dev.serror; 341 + return 0; 335 342 case SCR_ACTIVE: 336 - return dev->sata_dev.ap->sactive; 343 + *val = dev->sata_dev.ap->sactive; 344 + return 0; 337 345 default: 338 - return 0xffffffffU; 346 + return -EINVAL; 339 347 } 340 348 } 341 349