code: private static boolean validDeviceMode(String deviceMode) {
          Map<String, Boolean> validModes = new HashMap<>(3);
          validModes.put("r", true);
          validModes.put("w", true);
          validModes.put("m", true);
  
          if (isEmpty(deviceMode)) {
              return false;
          }
  
          for (char ch : deviceMode.toCharArray()) {
              final String mode = String.valueOf(ch);
              if (isNotTrue(validModes.get(mode))) {
                  return false; // wrong mode
              }
              validModes.put(mode, false);
          }
  
          return true;
      }
docs: ValidDeviceMode checks if the mode for device is valid or not.
  Valid mode is a composition of r (read), w (write), and m (mknod).
  
  @link https://github.com/docker/docker/blob/6b4a46f28266031ce1a1315f17fb69113a06efe1/runconfig/opts/parse.go#L796