spi: dw: refactor code that handles clk_div