Whenever any person licensed under this code is convicted of a violation of subdivision (b) of Section 22348, the court may, unless this code makes mandatory a revocation by the department, suspend the privilege of the person to operate a motor vehicle for a period of not to exceed 30 days.