In no event shall a court suspend the privilege of any person to operate a motor vehicle or as a condition of probation prohibit the operation of a motor vehicle for a period of time longer than that specified in this code. Any such prohibited order of a court, whether imposed as a condition of probation or otherwise, shall be null and void, and the department shall restore or reissue a license to any person entitled thereto irrespective of any such invalid order of a court.