The dispersion relation for the resistive wall modes (RWMs) is derived without the use of the trial function bHF proposed in S. W. Haney and J. P. Freidberg [Phys. Fluids B 1, 1637 (1989)] for the magnetic perturbation b outside the plasma. Another difference from the Haney–Freidberg (HF) approach is the incorporation of non-ideal effects in the plasma description. These enter the final result through the energy functional and affect the external solution for b through the boundary conditions only. This allows to perform the derivations in a general form without constraints on the dissipation mechanisms in the plasma. Then, the main mathematical difficulties are related to the description of the energy flow outside the plasma. This part of the task is presented with details allowing easy comparisons with the reference HF case. Being universally applicable, the resulting dispersion relation covers the existing variants, including those based on the so-called kinetic approaches. It shows that, because of its integral nature, the same predictions can be expected from various models for the plasma. Another conclusion is that, with a non-ideal contribution, just one or two free parameters would be enough to get agreement with experimental data on the plasma stability boundary. This, however, does not guarantee that the same choice of the fitting coefficients will be similarly efficient on other devices. The proposed relations provide a unified approach to the problem of plasma stability against RWMs.