Both...1 leading to the other.
Worked on it a bit with the irons in my 2 lessons, still in the correction phase
Do you know which caused the other: shut clubface caused flat swing or flat swing caused shut clubface?
Sometimes it can make the correction easier if you know which one to start with as the other will fall into place.