Was there any particular reason why Will Smith used his own name for his character in the TV series, The Fresh Prince of Bel-Air?

Maybe he wanted to get his name out there as an actor but still seems like a strange choice.