master/fsm_coe.c
changeset 998 05a24788f3b2
parent 992 50a44cbd30af
child 1035 7fafc1a7451e
equal deleted inserted replaced
997:652180478e95 998:05a24788f3b2
   464                 EC_WARN("Sdo dictionary of slave %u contains index 0x0000.\n",
   464                 EC_WARN("Sdo dictionary of slave %u contains index 0x0000.\n",
   465                         slave->ring_position);
   465                         slave->ring_position);
   466             continue;
   466             continue;
   467         }
   467         }
   468 
   468 
   469         if (!(sdo = (ec_sdo_t *) kmalloc(sizeof(ec_sdo_t), GFP_ATOMIC))) {
   469         if (!(sdo = (ec_sdo_t *) kmalloc(sizeof(ec_sdo_t), GFP_KERNEL))) {
   470             EC_ERR("Failed to allocate memory for Sdo!\n");
   470             EC_ERR("Failed to allocate memory for Sdo!\n");
   471             fsm->state = ec_fsm_coe_error;
   471             fsm->state = ec_fsm_coe_error;
   472             return;
   472             return;
   473         }
   473         }
   474 
   474 
   687     sdo->max_subindex = EC_READ_U8(data + 10);
   687     sdo->max_subindex = EC_READ_U8(data + 10);
   688     sdo->object_code = EC_READ_U8(data + 11);
   688     sdo->object_code = EC_READ_U8(data + 11);
   689 
   689 
   690     name_size = rec_size - 12;
   690     name_size = rec_size - 12;
   691     if (name_size) {
   691     if (name_size) {
   692         if (!(sdo->name = kmalloc(name_size + 1, GFP_ATOMIC))) {
   692         if (!(sdo->name = kmalloc(name_size + 1, GFP_KERNEL))) {
   693             EC_ERR("Failed to allocate Sdo name!\n");
   693             EC_ERR("Failed to allocate Sdo name!\n");
   694             fsm->state = ec_fsm_coe_error;
   694             fsm->state = ec_fsm_coe_error;
   695             return;
   695             return;
   696         }
   696         }
   697 
   697 
   902     }
   902     }
   903 
   903 
   904     data_size = rec_size - 16;
   904     data_size = rec_size - 16;
   905 
   905 
   906     if (!(entry = (ec_sdo_entry_t *)
   906     if (!(entry = (ec_sdo_entry_t *)
   907           kmalloc(sizeof(ec_sdo_entry_t), GFP_ATOMIC))) {
   907           kmalloc(sizeof(ec_sdo_entry_t), GFP_KERNEL))) {
   908         EC_ERR("Failed to allocate entry!\n");
   908         EC_ERR("Failed to allocate entry!\n");
   909         fsm->state = ec_fsm_coe_error;
   909         fsm->state = ec_fsm_coe_error;
   910         return;
   910         return;
   911     }
   911     }
   912 
   912 
   914     entry->data_type = EC_READ_U16(data + 10);
   914     entry->data_type = EC_READ_U16(data + 10);
   915     entry->bit_length = EC_READ_U16(data + 12);
   915     entry->bit_length = EC_READ_U16(data + 12);
   916 
   916 
   917     if (data_size) {
   917     if (data_size) {
   918         uint8_t *desc;
   918         uint8_t *desc;
   919         if (!(desc = kmalloc(data_size + 1, GFP_ATOMIC))) {
   919         if (!(desc = kmalloc(data_size + 1, GFP_KERNEL))) {
   920             EC_ERR("Failed to allocate Sdo entry name!\n");
   920             EC_ERR("Failed to allocate Sdo entry name!\n");
   921             fsm->state = ec_fsm_coe_error;
   921             fsm->state = ec_fsm_coe_error;
   922             return;
   922             return;
   923         }
   923         }
   924         memcpy(desc, data + 16, data_size);
   924         memcpy(desc, data + 16, data_size);