ctrls.handler)->sd;
 }
 
+static inline bool ov5640_is_csi2(const struct ov5640_dev *sensor)
+{
+       return sensor->ep.bus_type == V4L2_MBUS_CSI2_DPHY;
+}
+
 /*
  * FIXME: all of these register tables are likely filled with
  * entries that set the register to their power-on default values,
                /* remain in power down mode for DVP */
                if (regs->reg_addr == OV5640_REG_SYS_CTRL0 &&
                    val == OV5640_REG_SYS_CTRL0_SW_PWUP &&
-                   sensor->ep.bus_type != V4L2_MBUS_CSI2_DPHY)
+                   !ov5640_is_csi2(sensor))
                        continue;
 
                if (mask)
         * the same rate than YUV, so we can just use 16 bpp all the time.
         */
        rate = ov5640_calc_pixel_rate(sensor) * 16;
-       if (sensor->ep.bus_type == V4L2_MBUS_CSI2_DPHY) {
+       if (ov5640_is_csi2(sensor)) {
                rate = rate / sensor->ep.bus.mipi_csi2.num_data_lanes;
                ret = ov5640_set_mipi_pclk(sensor, rate);
        } else {
                        sensor->pending_fmt_change = false;
                }
 
-               if (sensor->ep.bus_type == V4L2_MBUS_CSI2_DPHY)
+               if (ov5640_is_csi2(sensor))
                        ret = ov5640_set_stream_mipi(sensor, enable);
                else
                        ret = ov5640_set_stream_dvp(sensor, enable);