Lines Matching refs:error

126  * Return negative errno code on error; return zero when success.
172 int error;
182 error = cyapa_i2c_reg_read_block(cyapa, BL_HEAD_OFFSET, BL_STATUS_SIZE,
190 if (cyapa->smbus && (error == -ETIMEDOUT || error == -ENXIO)) {
192 error = cyapa_read_block(cyapa,
197 if (error != BL_STATUS_SIZE)
198 goto error;
210 error = cyapa_gen3_ops.state_parse(cyapa,
212 if (!error)
218 error = cyapa_pip_state_parse(cyapa,
220 if (!error)
227 error = cyapa_gen5_ops.state_parse(cyapa,
229 if (!error)
240 error = cyapa_i2c_write(cyapa, 0, 2, cmd);
241 if (error)
242 goto error;
246 error = cyapa_i2c_read(cyapa, BL_HEAD_OFFSET,
248 if (error)
249 goto error;
253 goto error;
260 error:
261 return (error < 0) ? error : -EAGAIN;
281 int error;
285 error = cyapa_get_state(cyapa);
286 if (!error && cyapa->state > CYAPA_STATE_BL_BUSY)
292 return (error == -EAGAIN || error == -ETIMEDOUT) ? -ETIMEDOUT : error;
313 int error;
315 error = cyapa_poll_state(cyapa, 4000);
316 if (error)
317 return error;
333 error = cyapa->ops->operational_check(cyapa);
334 if (!error && cyapa_is_operational_mode(cyapa))
339 return error;
351 int error;
353 error = cyapa_check_is_operational(cyapa);
354 if (error) {
355 if (error != -ETIMEDOUT && error != -ENODEV &&
361 dev_err(dev, "no device detected: %d\n", error);
362 return error;
373 int error;
375 error = mutex_lock_interruptible(&cyapa->state_sync_lock);
376 if (error)
377 return error;
385 error = cyapa->ops->set_power_mode(cyapa,
387 if (error) {
388 dev_warn(dev, "set active power failed: %d\n", error);
392 error = cyapa_reinitialize(cyapa);
393 if (error || !cyapa->operational) {
394 error = error ? error : -EAGAIN;
410 return error;
437 int error;
507 error = input_mt_init_slots(input, CYAPA_MAX_MT_SLOTS,
509 if (error) {
510 dev_err(dev, "failed to initialize MT slots: %d\n", error);
511 return error;
515 error = input_register_device(input);
516 if (error) {
517 dev_err(dev, "failed to register input device: %d\n", error);
518 return error;
592 int error = 0;
607 error = cyapa_gen3_ops.initialize(cyapa);
608 if (!error)
609 error = cyapa_gen5_ops.initialize(cyapa);
610 if (!error)
611 error = cyapa_gen6_ops.initialize(cyapa);
612 if (error)
613 return error;
615 error = cyapa_detect(cyapa);
616 if (error)
617 return error;
631 int error;
641 error = cyapa_detect(cyapa);
642 if (error)
646 error = cyapa_create_input_dev(cyapa);
647 if (error) {
649 error);
660 } else if (!error && cyapa->operational) {
673 return error;
680 int error;
701 error = cyapa->ops->irq_handler(cyapa);
717 if (!cyapa->operational || error) {
746 int error;
748 error = mutex_lock_interruptible(&cyapa->state_sync_lock);
749 if (error)
750 return error;
783 int error;
785 error = mutex_lock_interruptible(&cyapa->state_sync_lock);
786 if (error)
787 return error;
832 int error;
835 error = sysfs_merge_group(&dev->kobj,
837 if (error) {
839 error);
840 return error;
843 error = devm_add_action_or_reset(dev,
845 if (error) {
847 error);
848 return error;
869 int error;
871 error = mutex_lock_interruptible(&cyapa->state_sync_lock);
872 if (error)
873 return error;
892 int error;
906 error = mutex_lock_interruptible(&cyapa->state_sync_lock);
907 if (error)
908 return error;
946 int error;
952 error = sysfs_merge_group(&dev->kobj, &cyapa_power_runtime_group);
953 if (error) {
955 "failed to create power runtime group: %d\n", error);
956 return error;
959 error = devm_add_action_or_reset(dev, cyapa_remove_power_runtime_group,
961 if (error) {
964 error);
965 return error;
985 int error;
988 error = mutex_lock_interruptible(&cyapa->state_sync_lock);
989 if (error)
990 return error;
991 error = sysfs_emit(buf, "%d.%d\n",
994 return error;
1002 int error;
1004 error = mutex_lock_interruptible(&cyapa->state_sync_lock);
1005 if (error)
1006 return error;
1016 int error;
1018 error = request_firmware(&fw, fw_name, dev);
1019 if (error) {
1021 fw_name, error);
1022 return error;
1025 error = cyapa->ops->check_fw(cyapa, fw);
1026 if (error) {
1042 error = cyapa->ops->bl_enter(cyapa);
1043 if (error) {
1044 dev_err(dev, "bl_enter failed, %d\n", error);
1048 error = cyapa->ops->bl_activate(cyapa);
1049 if (error) {
1050 dev_err(dev, "bl_activate failed, %d\n", error);
1054 error = cyapa->ops->bl_initiate(cyapa, fw);
1055 if (error) {
1056 dev_err(dev, "bl_initiate failed, %d\n", error);
1060 error = cyapa->ops->update_fw(cyapa, fw);
1061 if (error) {
1062 dev_err(dev, "update_fw failed, %d\n", error);
1072 return error;
1081 int ret, error;
1104 error = mutex_lock_interruptible(&cyapa->state_sync_lock);
1105 if (error) {
1111 return error;
1114 error = cyapa_firmware(cyapa, fw_name);
1115 if (error)
1116 dev_err(dev, "firmware update failed: %d\n", error);
1127 error = error ? error : ret;
1132 return error ? error : count;
1140 int error;
1142 error = mutex_lock_interruptible(&cyapa->state_sync_lock);
1143 if (error)
1144 return error;
1148 error = cyapa->ops->calibrate_store(dev, attr, buf, count);
1151 error = -EBUSY; /* Still running in bootloader mode. */
1155 return error < 0 ? error : count;
1162 ssize_t error;
1164 error = mutex_lock_interruptible(&cyapa->state_sync_lock);
1165 if (error)
1166 return error;
1170 error = cyapa->ops->show_baseline(dev, attr, buf);
1173 error = -EBUSY; /* Still running in bootloader mode. */
1177 return error;
1206 int error;
1208 error = mutex_lock_interruptible(&cyapa->state_sync_lock);
1209 if (error)
1210 return error;
1250 int error;
1278 error = PTR_ERR(cyapa->vcc);
1279 dev_err(dev, "failed to get vcc regulator: %d\n", error);
1280 return error;
1283 error = regulator_enable(cyapa->vcc);
1284 if (error) {
1285 dev_err(dev, "failed to enable regulator: %d\n", error);
1286 return error;
1289 error = devm_add_action_or_reset(dev, cyapa_disable_regulator, cyapa);
1290 if (error) {
1292 error);
1293 return error;
1296 error = cyapa_initialize(cyapa);
1297 if (error) {
1299 return error;
1302 error = cyapa_prepare_wakeup_controls(cyapa);
1303 if (error) {
1304 dev_err(dev, "failed to prepare wakeup controls: %d\n", error);
1305 return error;
1308 error = cyapa_start_runtime(cyapa);
1309 if (error) {
1310 dev_err(dev, "failed to start pm_runtime: %d\n", error);
1311 return error;
1314 error = devm_request_threaded_irq(dev, client->irq,
1318 if (error) {
1319 dev_err(dev, "failed to request threaded irq: %d\n", error);
1320 return error;
1332 error = cyapa_create_input_dev(cyapa);
1333 if (error) {
1335 error);
1336 return error;
1348 int error;
1350 error = mutex_lock_interruptible(&cyapa->state_sync_lock);
1351 if (error)
1352 return error;
1370 error = cyapa->ops->set_power_mode(cyapa, power_mode,
1372 if (error)
1374 error);
1395 int error;
1408 error = cyapa_reinitialize(cyapa);
1409 if (error)
1410 dev_warn(dev, "failed to reinitialize TP device: %d\n", error);
1421 int error;
1423 error = cyapa->ops->set_power_mode(cyapa,
1427 if (error)
1428 dev_warn(dev, "runtime suspend failed: %d\n", error);
1436 int error;
1438 error = cyapa->ops->set_power_mode(cyapa,
1440 if (error)
1441 dev_warn(dev, "runtime resume failed: %d\n", error);