equal
deleted
inserted
replaced
411 EC_ERR("Failed to init SDO!\n"); |
411 EC_ERR("Failed to init SDO!\n"); |
412 fsm->state = ec_fsm_coe_error; |
412 fsm->state = ec_fsm_coe_error; |
413 return; |
413 return; |
414 } |
414 } |
415 |
415 |
416 if (kobject_add(&sdo->kobj)) { |
|
417 EC_ERR("Failed to add kobject.\n"); |
|
418 kobject_put(&sdo->kobj); // free |
|
419 fsm->state = ec_fsm_coe_error; |
|
420 return; |
|
421 } |
|
422 |
|
423 list_add_tail(&sdo->list, &slave->sdo_dictionary); |
416 list_add_tail(&sdo->list, &slave->sdo_dictionary); |
424 } |
417 } |
425 |
418 |
426 if (EC_READ_U8(data + 2) & 0x80) { // more messages waiting. check again. |
419 if (EC_READ_U8(data + 2) & 0x80) { // more messages waiting. check again. |
427 fsm->cycles_start = datagram->cycles_sent; |
420 fsm->cycles_start = datagram->cycles_sent; |
774 |
767 |
775 entry->data_type = EC_READ_U16(data + 10); |
768 entry->data_type = EC_READ_U16(data + 10); |
776 entry->bit_length = EC_READ_U16(data + 12); |
769 entry->bit_length = EC_READ_U16(data + 12); |
777 |
770 |
778 if (data_size) { |
771 if (data_size) { |
779 if (!(entry->description = kmalloc(data_size + 1, GFP_ATOMIC))) { |
772 uint8_t *desc; |
|
773 if (!(desc = kmalloc(data_size + 1, GFP_ATOMIC))) { |
780 EC_ERR("Failed to allocate SDO entry name!\n"); |
774 EC_ERR("Failed to allocate SDO entry name!\n"); |
781 fsm->state = ec_fsm_coe_error; |
775 fsm->state = ec_fsm_coe_error; |
782 return; |
776 return; |
783 } |
777 } |
784 memcpy(entry->description, data + 16, data_size); |
778 memcpy(desc, data + 16, data_size); |
785 entry->description[data_size] = 0; |
779 desc[data_size] = 0; |
786 } |
780 entry->description = desc; |
787 |
|
788 if (kobject_add(&entry->kobj)) { |
|
789 EC_ERR("Failed to add kobject.\n"); |
|
790 kobject_put(&entry->kobj); // free |
|
791 fsm->state = ec_fsm_coe_error; |
|
792 return; |
|
793 } |
781 } |
794 |
782 |
795 list_add_tail(&entry->list, &sdo->entries); |
783 list_add_tail(&entry->list, &sdo->entries); |
796 |
784 |
797 if (fsm->subindex < sdo->subindices) { |
785 if (fsm->subindex < sdo->subindices) { |