Equations describing drift-Alfvén eigenmodes and drift-sound eigenmodes in tokamaks and stellarators are derived. They generalize corresponding equations of Kolesnichenko et al (2009 Europhys. Lett.85 25004), being valid for arbitrary ratio of the diamagnetic drift frequency to the frequency of the geodesic acoustic mode and taking into account the inhomogeneity of the plasma temperature.