An operator inequality and self-adjointness