Lines Matching full: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, err; 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()
159 rc = __get_scom(scom, &ind_data, addr, status); in put_indirect_scom_form0()
160 if (rc || (*status & SCOM_STATUS_ANY_ERR)) in put_indirect_scom_form0()
161 return rc; in put_indirect_scom_form0()
186 int rc, err; in get_indirect_scom_form0() local
190 rc = __put_scom(scom, ind_data, ind_addr, status); in get_indirect_scom_form0()
191 if (rc || (*status & SCOM_STATUS_ANY_ERR)) in get_indirect_scom_form0()
192 return rc; in get_indirect_scom_form0()
194 rc = __get_scom(scom, &ind_data, addr, status); in get_indirect_scom_form0()
195 if (rc || (*status & SCOM_STATUS_ANY_ERR)) in get_indirect_scom_form0()
196 return rc; in get_indirect_scom_form0()
278 int rc; in put_scom() local
280 rc = raw_put_scom(scom, value, addr, &status); in put_scom()
281 if (rc) in put_scom()
282 return rc; in put_scom()
284 rc = handle_fsi2pib_status(scom, status); in put_scom()
285 if (rc) in put_scom()
286 return rc; in put_scom()
297 int rc; in get_scom() local
299 rc = raw_get_scom(scom, value, addr, &status); in get_scom()
300 if (rc) in get_scom()
301 return rc; in get_scom()
303 rc = handle_fsi2pib_status(scom, status); in get_scom()
304 if (rc) in get_scom()
305 return rc; in get_scom()
318 int rc; in scom_read() local
325 rc = -ENODEV; in scom_read()
327 rc = get_scom(scom, &val, *offset); in scom_read()
329 if (rc) { in scom_read()
330 dev_dbg(dev, "get_scom fail:%d\n", rc); in scom_read()
331 return rc; in scom_read()
334 rc = copy_to_user(buf, &val, len); in scom_read()
335 if (rc) in scom_read()
336 dev_dbg(dev, "copy to user failed:%d\n", rc); in scom_read()
338 return rc ? rc : len; in scom_read()
344 int rc; in scom_write() local
352 rc = copy_from_user(&val, buf, len); in scom_write()
353 if (rc) { in scom_write()
354 dev_dbg(dev, "copy from user failed:%d\n", rc); in scom_write()
360 rc = -ENODEV; in scom_write()
362 rc = put_scom(scom, val, *offset); in scom_write()
364 if (rc) { in scom_write()
365 dev_dbg(dev, "put_scom failed with:%d\n", rc); in scom_write()
366 return rc; in scom_write()
407 int rc; in scom_raw_read() local
412 rc = raw_get_scom(scom, &acc.data, acc.addr, &status); in scom_raw_read()
413 if (rc) in scom_raw_read()
414 return rc; in scom_raw_read()
426 int rc; in scom_raw_write() local
432 rc = raw_get_scom(scom, &prev_data, acc.addr, &status); in scom_raw_write()
433 if (rc) in scom_raw_write()
434 return rc; in scom_raw_write()
442 rc = raw_put_scom(scom, data, acc.addr, &status); in scom_raw_write()
443 if (rc) in scom_raw_write()
444 return rc; in scom_raw_write()
455 int rc = 0; in scom_reset() local
460 rc = fsi_device_write(scom->fsi_dev, SCOM_PIB_RESET_REG, &dummy, in scom_reset()
462 if (!rc && (flags & (SCOM_RESET_PIB | SCOM_RESET_INTF))) in scom_reset()
463 rc = fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG, &dummy, in scom_reset()
465 return rc; in scom_reset()
478 int rc = -ENOTTY; in scom_ioctl() local
487 rc = scom_check(scom, argp); in scom_ioctl()
490 rc = scom_raw_read(scom, argp); in scom_ioctl()
493 rc = scom_raw_write(scom, argp); in scom_ioctl()
496 rc = scom_reset(scom, argp); in scom_ioctl()
500 return rc; in scom_ioctl()
533 int rc, didx; in scom_probe() local
555 rc = fsi_get_new_minor(fsi_dev, fsi_dev_scom, &scom->dev.devt, &didx); in scom_probe()
556 if (rc) in scom_probe()
561 rc = cdev_device_add(&scom->cdev, &scom->dev); in scom_probe()
562 if (rc) { in scom_probe()
564 rc, dev_name(&scom->dev)); in scom_probe()
573 return rc; in scom_probe()