Regularity of solutions to an abstract inhomogeneous linear differential equation