  We consider a 2D ballistic and quasi-ballistic structures with
spin-orbit-related splitting of the electron spectrum. The ballistic region is
attached to the leads with a voltage applied between them. We calculate the
edge spin density which arises in the presence of a charge current through the
structure. We solve the problem with the use of the method of scattering states
and clarify the important role of the unitarity of scattering. In the case of a
straight boundary it leads to exact cancellation of long-wavelength
oscillations of the spin density. In general, however, the smooth spin
oscillations with the spin precession length may arise, as it happens, e.g.,
for the wiggly boundary. Moreover, we show that the result crucially depends on
the form of the spin-orbit Hamiltonian.
