You seems to be handling the devctl call properly. It could be one of the argument of send.* that is wrong. Check the doc of the driver (assuming there is some).
i am have an i2c driver for a board . but finding erors when i built the application like incomplete data send , receive buffer is too short etc , i have tried every sort to remove these bugs …but coulnt succeed …so can u plz send me u r application code . any help would be appreciated.