OSDN Git Service

Merge remote-tracking branches 'spi/topic/qup', 'spi/topic/rockchip', 'spi/topic...
[uclinux-h8/linux.git] / drivers / spi / spi-rockchip.c
index f65384b..68e7efe 100644 (file)
@@ -527,7 +527,7 @@ static void rockchip_spi_config(struct rockchip_spi *rs)
        }
 
        /* div doesn't support odd number */
-       div = max_t(u32, rs->max_freq / rs->speed, 1);
+       div = DIV_ROUND_UP(rs->max_freq, rs->speed);
        div = (div + 1) & 0xfffe;
 
        /* Rx sample delay is expressed in parent clock cycles (max 3) */