Ewan McGregor has joined the cast of HBO's upcoming drama The Corrections. It will be the actor's first regular TV role.

The Corrections is based on the acclaimed novel of the same name by Jonathan Franzen. The story traces the lives of a Midwestern couple and their three adult children. Ewan McGregor will play the middle child, a Marxist academic who loses his tenure position after indulging in an affair with a student.

Noah Baumbach wrote the pilot with novelist Jonathan Franzen, and he is set to direct as well. Noah Baumbach is producing The Corrections alongside Scott Rudin.

HBO is expected to debut The Corrections sometime in 2013.