Writing a register of LMS7002M

Hi guys ,
I am using LMS7002M driver for development . I am able to read back any register using the function LMS7002M_spi_read(lms,addr) .
However, I have trouble writing to the device from LMS7002M_spi_write(lms,addr,value) .I am only getting the default value . I am writing to the register 0x0121 . What am I doing wrong ?

Never mind . I found a solution . I was resetting the connection everytime . Issue is resolved .