Lines Matching refs:rc

79 	int rc;  in __put_scom()  local
82 rc = fsi_device_write(scom_dev->fsi_dev, SCOM_DATA0_REG, &data, in __put_scom()
84 if (rc) in __put_scom()
85 return rc; in __put_scom()
88 rc = fsi_device_write(scom_dev->fsi_dev, SCOM_DATA1_REG, &data, in __put_scom()
90 if (rc) in __put_scom()
91 return rc; in __put_scom()
94 rc = fsi_device_write(scom_dev->fsi_dev, SCOM_CMD_REG, &data, in __put_scom()
96 if (rc) in __put_scom()
97 return rc; in __put_scom()
98 rc = fsi_device_read(scom_dev->fsi_dev, SCOM_STATUS_REG, &raw_status, in __put_scom()
100 if (rc) in __put_scom()
101 return rc; in __put_scom()
111 int rc; in __get_scom() local
116 rc = fsi_device_write(scom_dev->fsi_dev, SCOM_CMD_REG, &data, in __get_scom()
118 if (rc) in __get_scom()
119 return rc; in __get_scom()
120 rc = fsi_device_read(scom_dev->fsi_dev, SCOM_STATUS_REG, &raw_status, in __get_scom()
122 if (rc) in __get_scom()
123 return rc; in __get_scom()
129 rc = fsi_device_read(scom_dev->fsi_dev, SCOM_DATA0_REG, &data, in __get_scom()
131 if (rc) in __get_scom()
132 return rc; in __get_scom()
134 rc = fsi_device_read(scom_dev->fsi_dev, SCOM_DATA1_REG, &data, in __get_scom()
136 if (rc) in __get_scom()
137 return rc; in __get_scom()
141 return rc; in __get_scom()
148 int rc, retries, err = 0; in put_indirect_scom_form0() local
155 rc = __put_scom(scom, ind_data, ind_addr, status); in put_indirect_scom_form0()
156 if (rc || (*status & SCOM_STATUS_ANY_ERR)) in put_indirect_scom_form0()
157 return rc; in put_indirect_scom_form0()
160 rc = __get_scom(scom, &ind_data, addr, status); in put_indirect_scom_form0()
161 if (rc || (*status & SCOM_STATUS_ANY_ERR)) in put_indirect_scom_form0()
162 return rc; in put_indirect_scom_form0()
171 return rc; in put_indirect_scom_form0()
191 int rc, retries, err = 0; in get_indirect_scom_form0() local
195 rc = __put_scom(scom, ind_data, ind_addr, status); in get_indirect_scom_form0()
196 if (rc || (*status & SCOM_STATUS_ANY_ERR)) in get_indirect_scom_form0()
197 return rc; in get_indirect_scom_form0()
200 rc = __get_scom(scom, &ind_data, addr, status); in get_indirect_scom_form0()
201 if (rc || (*status & SCOM_STATUS_ANY_ERR)) in get_indirect_scom_form0()
202 return rc; in get_indirect_scom_form0()
213 return rc; in get_indirect_scom_form0()
288 int rc, retries; in put_scom() local
291 rc = raw_put_scom(scom, value, addr, &status); in put_scom()
292 if (rc) { in put_scom()
294 if (rc != -ENODEV && retries == 0) { in put_scom()
297 rc = -EBUSY; in put_scom()
299 return rc; in put_scom()
301 rc = handle_fsi2pib_status(scom, status); in put_scom()
302 if (rc && rc != -EBUSY) in put_scom()
304 if (rc == 0) { in put_scom()
305 rc = handle_pib_status(scom, in put_scom()
308 if (rc && rc != -EBUSY) in put_scom()
311 if (rc == 0) in put_scom()
315 return rc; in put_scom()
322 int rc, retries; in get_scom() local
325 rc = raw_get_scom(scom, value, addr, &status); in get_scom()
326 if (rc) { in get_scom()
328 if (rc != -ENODEV && retries == 0) { in get_scom()
331 rc = -EBUSY; in get_scom()
333 return rc; in get_scom()
335 rc = handle_fsi2pib_status(scom, status); in get_scom()
336 if (rc && rc != -EBUSY) in get_scom()
338 if (rc == 0) { in get_scom()
339 rc = handle_pib_status(scom, in get_scom()
342 if (rc && rc != -EBUSY) in get_scom()
345 if (rc == 0) in get_scom()
349 return rc; in get_scom()
358 int rc; in scom_read() local
365 rc = -ENODEV; in scom_read()
367 rc = get_scom(scom, &val, *offset); in scom_read()
369 if (rc) { in scom_read()
370 dev_dbg(dev, "get_scom fail:%d\n", rc); in scom_read()
371 return rc; in scom_read()
374 rc = copy_to_user(buf, &val, len); in scom_read()
375 if (rc) in scom_read()
376 dev_dbg(dev, "copy to user failed:%d\n", rc); in scom_read()
378 return rc ? rc : len; in scom_read()
384 int rc; in scom_write() local
392 rc = copy_from_user(&val, buf, len); in scom_write()
393 if (rc) { in scom_write()
394 dev_dbg(dev, "copy from user failed:%d\n", rc); in scom_write()
400 rc = -ENODEV; in scom_write()
402 rc = put_scom(scom, val, *offset); in scom_write()
404 if (rc) { in scom_write()
405 dev_dbg(dev, "put_scom failed with:%d\n", rc); in scom_write()
406 return rc; in scom_write()
447 int rc; in scom_raw_read() local
452 rc = raw_get_scom(scom, &acc.data, acc.addr, &status); in scom_raw_read()
453 if (rc) in scom_raw_read()
454 return rc; in scom_raw_read()
466 int rc; in scom_raw_write() local
472 rc = raw_get_scom(scom, &prev_data, acc.addr, &status); in scom_raw_write()
473 if (rc) in scom_raw_write()
474 return rc; in scom_raw_write()
482 rc = raw_put_scom(scom, data, acc.addr, &status); in scom_raw_write()
483 if (rc) in scom_raw_write()
484 return rc; in scom_raw_write()
495 int rc = 0; in scom_reset() local
500 rc = fsi_device_write(scom->fsi_dev, SCOM_PIB_RESET_REG, &dummy, in scom_reset()
502 if (!rc && (flags & (SCOM_RESET_PIB | SCOM_RESET_INTF))) in scom_reset()
503 rc = fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG, &dummy, in scom_reset()
505 return rc; in scom_reset()
518 int rc = -ENOTTY; in scom_ioctl() local
527 rc = scom_check(scom, argp); in scom_ioctl()
530 rc = scom_raw_read(scom, argp); in scom_ioctl()
533 rc = scom_raw_write(scom, argp); in scom_ioctl()
536 rc = scom_reset(scom, argp); in scom_ioctl()
540 return rc; in scom_ioctl()
573 int rc, didx; in scom_probe() local
595 rc = fsi_get_new_minor(fsi_dev, fsi_dev_scom, &scom->dev.devt, &didx); in scom_probe()
596 if (rc) in scom_probe()
601 rc = cdev_device_add(&scom->cdev, &scom->dev); in scom_probe()
602 if (rc) { in scom_probe()
604 rc, dev_name(&scom->dev)); in scom_probe()
613 return rc; in scom_probe()