A note on the equation of state for systems that undergo valence changes