Lines Matching full:rc
80 int rc; in __put_scom() local
83 rc = fsi_device_write(scom_dev->fsi_dev, SCOM_DATA0_REG, &data, in __put_scom()
85 if (rc) in __put_scom()
86 return rc; in __put_scom()
89 rc = fsi_device_write(scom_dev->fsi_dev, SCOM_DATA1_REG, &data, in __put_scom()
91 if (rc) in __put_scom()
92 return rc; in __put_scom()
95 rc = fsi_device_write(scom_dev->fsi_dev, SCOM_CMD_REG, &data, in __put_scom()
97 if (rc) in __put_scom()
98 return rc; in __put_scom()
99 rc = fsi_device_read(scom_dev->fsi_dev, SCOM_STATUS_REG, &raw_status, in __put_scom()
101 if (rc) in __put_scom()
102 return rc; in __put_scom()
112 int rc; in __get_scom() local
117 rc = fsi_device_write(scom_dev->fsi_dev, SCOM_CMD_REG, &data, in __get_scom()
119 if (rc) in __get_scom()
120 return rc; in __get_scom()
121 rc = fsi_device_read(scom_dev->fsi_dev, SCOM_STATUS_REG, &raw_status, in __get_scom()
123 if (rc) in __get_scom()
124 return rc; in __get_scom()
130 rc = fsi_device_read(scom_dev->fsi_dev, SCOM_DATA0_REG, &data, in __get_scom()
132 if (rc) in __get_scom()
133 return rc; in __get_scom()
135 rc = fsi_device_read(scom_dev->fsi_dev, SCOM_DATA1_REG, &data, in __get_scom()
137 if (rc) in __get_scom()
138 return rc; in __get_scom()
142 return rc; in __get_scom()
149 int rc, err; in put_indirect_scom_form0() local
156 rc = __put_scom(scom, ind_data, ind_addr, status); in put_indirect_scom_form0()
157 if (rc || (*status & SCOM_STATUS_ANY_ERR)) in put_indirect_scom_form0()
158 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()
187 int rc, err; in get_indirect_scom_form0() local
191 rc = __put_scom(scom, ind_data, ind_addr, status); in get_indirect_scom_form0()
192 if (rc || (*status & SCOM_STATUS_ANY_ERR)) in get_indirect_scom_form0()
193 return rc; in get_indirect_scom_form0()
195 rc = __get_scom(scom, &ind_data, 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()
279 int rc; in put_scom() local
281 rc = raw_put_scom(scom, value, addr, &status); in put_scom()
282 if (rc) in put_scom()
283 return rc; in put_scom()
285 rc = handle_fsi2pib_status(scom, status); in put_scom()
286 if (rc) in put_scom()
287 return rc; in put_scom()
298 int rc; in get_scom() local
300 rc = raw_get_scom(scom, value, addr, &status); in get_scom()
301 if (rc) in get_scom()
302 return rc; in get_scom()
304 rc = handle_fsi2pib_status(scom, status); in get_scom()
305 if (rc) in get_scom()
306 return rc; in get_scom()
319 int rc; in scom_read() local
326 rc = -ENODEV; in scom_read()
328 rc = get_scom(scom, &val, *offset); in scom_read()
330 if (rc) { in scom_read()
331 dev_dbg(dev, "get_scom fail:%d\n", rc); in scom_read()
332 return rc; in scom_read()
335 rc = copy_to_user(buf, &val, len); in scom_read()
336 if (rc) in scom_read()
337 dev_dbg(dev, "copy to user failed:%d\n", rc); in scom_read()
339 return rc ? rc : len; in scom_read()
345 int rc; in scom_write() local
353 rc = copy_from_user(&val, buf, len); in scom_write()
354 if (rc) { in scom_write()
355 dev_dbg(dev, "copy from user failed:%d\n", rc); in scom_write()
361 rc = -ENODEV; in scom_write()
363 rc = put_scom(scom, val, *offset); in scom_write()
365 if (rc) { in scom_write()
366 dev_dbg(dev, "put_scom failed with:%d\n", rc); in scom_write()
367 return rc; in scom_write()
408 int rc; in scom_raw_read() local
413 rc = raw_get_scom(scom, &acc.data, acc.addr, &status); in scom_raw_read()
414 if (rc) in scom_raw_read()
415 return rc; in scom_raw_read()
427 int rc; in scom_raw_write() local
433 rc = raw_get_scom(scom, &prev_data, acc.addr, &status); in scom_raw_write()
434 if (rc) in scom_raw_write()
435 return rc; in scom_raw_write()
443 rc = raw_put_scom(scom, data, acc.addr, &status); in scom_raw_write()
444 if (rc) in scom_raw_write()
445 return rc; in scom_raw_write()
456 int rc = 0; in scom_reset() local
461 rc = fsi_device_write(scom->fsi_dev, SCOM_PIB_RESET_REG, &dummy, in scom_reset()
463 if (!rc && (flags & (SCOM_RESET_PIB | SCOM_RESET_INTF))) in scom_reset()
464 rc = fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG, &dummy, in scom_reset()
466 return rc; in scom_reset()
479 int rc = -ENOTTY; in scom_ioctl() local
488 rc = scom_check(scom, argp); in scom_ioctl()
491 rc = scom_raw_read(scom, argp); in scom_ioctl()
494 rc = scom_raw_write(scom, argp); in scom_ioctl()
497 rc = scom_reset(scom, argp); in scom_ioctl()
501 return rc; in scom_ioctl()
534 int rc, didx; in scom_probe() local
556 rc = fsi_get_new_minor(fsi_dev, fsi_dev_scom, &scom->dev.devt, &didx); in scom_probe()
557 if (rc) in scom_probe()
562 rc = cdev_device_add(&scom->cdev, &scom->dev); in scom_probe()
563 if (rc) { in scom_probe()
565 rc, dev_name(&scom->dev)); in scom_probe()
574 return rc; in scom_probe()