Lines Matching +defs:error +defs:value
213 int fd = -1, valid, error = 0, validsub = -1, validsubsub = -1;
215 int start_reg = 0xff, end_reg, value, tvalue, instance;
252 error = emcfan_read_register(fd, EMCFAN_PRODUCT_ID, &product_id, debug);
254 if (error)
255 err(EXIT_FAILURE, "read product_id %d", error);
272 error = output_emcfan_info(fd, product_id, product_family, jsonify, debug);
273 if (error != 0) {
274 errno = error;
286 error = output_emcfan_apd(fd, product_id, product_family, EMCFAN_CHIP_CONFIG, jsonify, debug);
287 if (error != 0) {
288 fprintf(stderr, "Error output for apd subcommand: %d\n",error);
296 fprintf(stderr,"Error converting human value: %s\n", argv[4]);
299 error = emcfan_rmw_register(fd, EMCFAN_CHIP_CONFIG, 0, apd, __arraycount(apd), tvalue, debug);
300 if (error != 0) {
301 errno = error;
340 error = output_emcfan_smbusto(fd, product_id, product_family, start_reg, instance, jsonify, debug);
341 if (error != 0) {
342 fprintf(stderr, "Error output for SMBUS timeout subcommand: %d\n",error);
350 fprintf(stderr,"Error converting human value: %s\n", argv[4]);
353 error = emcfan_rmw_register(fd, start_reg, 0, smbus_timeout, __arraycount(smbus_timeout), tvalue, debug);
354 if (error != 0) {
355 errno = error;
381 start_reg = (uint8_t)strtoi(argv[3], NULL, 0, 0, 0xff, &error);
382 if (error) {
391 end_reg = (uint8_t)strtoi(argv[4], NULL, 0, 0, 0xff, &error);
392 if (error) {
412 error = output_emcfan_register_read(fd, product_id, product_family, start_reg, end_reg, jsonify, debug);
413 if (error != 0) {
414 fprintf(stderr, "Error read register: %d\n",error);
421 start_reg = (uint8_t)strtoi(argv[3], NULL, 0, 0, 0xff, &error);
422 if (error) {
430 value = (uint8_t)strtoi(argv[4], NULL, 0, 0, 0xff, &error);
431 if (error) {
432 fprintf(stderr,"Could not convert value for register write.\n");
443 fprintf(stderr,"register write: START_REG: %d 0x%02X, VALUE: %d 0x%02X\n",start_reg, start_reg, value, value);
445 error = emcfan_write_register(fd, start_reg, value, debug);
446 if (error != 0) {
447 errno = error;
466 the_fan = strtoi(argv[2], NULL, 0, 1, emcfan_chip_infos[iindex].num_fans, &error);
467 if (error) {
502 the_fan = strtoi(argv[2], NULL, 0, 1, emcfan_chip_infos[iindex].num_tachs, &error);
503 if (error) {
584 error = output_emcfan_fan_status(fd, product_id, product_family, start_reg, end_reg, the_fan, jsonify, debug);
585 if (error != 0) {
586 fprintf(stderr, "Error fan status for fan subcommand: %d\n",error);
596 error = output_emcfan_drive(fd, product_id, product_family, start_reg, jsonify, debug);
598 error = output_emcfan_divider(fd, product_id, product_family, start_reg, jsonify, debug);
599 if (error != 0) {
600 fprintf(stderr, "Error read drive / divider for fan subcommand: %d\n",error);
605 value = (uint8_t)strtoi(argv[5], NULL, 0, 0, 0xff, &error);
606 if (error) {
607 fprintf(stderr,"Could not convert value for fan subcommand write.\n");
611 error = emcfan_write_register(fd, start_reg, value, debug);
612 if (error != 0) {
613 errno = error;
632 error = output_emcfan_minexpected_rpm(fd, product_id, product_family, start_reg, jsonify, debug);
633 if (error != 0) {
634 fprintf(stderr, "Error read minexpected rpm subcommand: %d\n",error);
639 value = (int)strtoi(argv[5], NULL, 0, 0, 0xffff, &error);
640 if (error) {
641 fprintf(stderr,"Could not convert value for minexpected rpm subcommand write.\n");
645 tvalue = find_translated_bits_by_hint(fan_minexpectedrpm, __arraycount(fan_minexpectedrpm), value);
647 fprintf(stderr,"Error converting human value: %d %d\n",value, tvalue);
650 error = emcfan_rmw_register(fd, start_reg, value, fan_minexpectedrpm, __arraycount(fan_minexpectedrpm), tvalue, debug);
651 if (error != 0) {
652 errno = error;
671 error = output_emcfan_edges(fd, product_id, product_family, start_reg, jsonify, debug);
672 if (error != 0) {
673 fprintf(stderr, "Error read edges subcommand: %d\n",error);
678 value = (uint8_t)strtoi(argv[5], NULL, 0, 0, 9, &error);
679 if (error) {
680 fprintf(stderr,"Could not convert value for edges subcommand write.\n");
684 tvalue = find_translated_bits_by_hint(fan_numedges, __arraycount(fan_numedges), value);
686 fprintf(stderr,"Error converting human value: %d\n",value);
689 error = emcfan_rmw_register(fd, start_reg, value, fan_numedges, __arraycount(fan_numedges), tvalue, debug);
690 if (error != 0) {
691 errno = error;
710 error = output_emcfan_polarity(fd, product_id, product_family, start_reg, the_fan, jsonify, debug);
711 if (error != 0) {
712 fprintf(stderr, "Error output for polarity subcommand: %d\n",error);
725 fprintf(stderr,"Error converting human value: %s\n", argv[4]);
728 error = emcfan_rmw_register(fd, start_reg, 0, fan_polarity, __arraycount(fan_polarity), tvalue, debug);
729 if (error != 0) {
730 errno = error;
753 error = output_emcfan_pwm_basefreq(fd, product_id, product_family, start_reg, the_fan, jsonify, debug);
756 error = output_emcfan_pwm_basefreq(fd, product_id, product_family, start_reg, the_fan, jsonify, debug);
758 error = output_emcfan_pwm_basefreq(fd, product_id, product_family, start_reg,
760 if (error != 0) {
761 fprintf(stderr, "Error read base_freq subcommand: %d\n",error);
766 value = (int)strtoi(argv[5], NULL, 0, 0, 0xffff, &error);
767 if (error) {
768 fprintf(stderr,"Could not convert value for base_freq subcommand write.\n");
773 tvalue = find_translated_bits_by_hint_instance(fan_pwm_basefreq, __arraycount(fan_pwm_basefreq), value, the_fan);
776 tvalue = find_translated_bits_by_hint_instance(fan_pwm_basefreq, __arraycount(fan_pwm_basefreq), value, the_fan);
779 value, the_fan + 23050);
781 fprintf(stderr,"Error converting human value: %d %d\n",value, tvalue);
784 error = emcfan_rmw_register(fd, start_reg, value, fan_pwm_basefreq, __arraycount(fan_pwm_basefreq), tvalue, debug);
785 if (error != 0) {
786 errno = error;
806 error = output_emcfan_pwm_output_type(fd, product_id, product_family, start_reg, the_fan, jsonify, debug);
807 if (error != 0) {
808 fprintf(stderr, "Error output for pwm_output_type subcommand: %d\n",error);
816 fprintf(stderr,"Error converting human value: %s\n", argv[4]);
819 error = emcfan_rmw_register(fd, start_reg, 0, fan_pwm_output_type, __arraycount(fan_pwm_output_type), tvalue, debug);
820 if (error != 0) {
821 errno = error;