A Windsor man will not go to jail after pleading guilty to whipping his six-year-old son with a charging chord for eating his toast too slowly.

He has been given a conditional discharge.

Ontario court Judge Sharman Bondy told the court Wednesday that corporal punishment was no answer to loving parenting. She sentenced the man to three years of probation.

“The Children's Aid Society had significant onerous tasks that he was required to complete and he did so, he followed their directions and he complied of what they asked him to do," says his lawyer Patricia Brown.

The man, who cannot be named to protect his child's identity, had pleaded guilty to assault with a weapon for the incident that left the boy with welts on his body.

School authorities discovered the welts in December 2015, and the boy's father later admitted to hitting him with a USB charging chord.

Bondy cited the first-time offender's remorse, guilty plea and efforts at rehabilitation, which include taking anger management and parenting courses.

The boy's mother described the father as having a loving and good relationship with his son.

All four children were taken away from the man and his wife in 2015, when he was charged.  They were returned to the care of the mother last Spring, and the father has had visitation rights which have been "steadily" increasing from supervised by CAS to monitored by the wife.

Brown said the family was relieved these "significant dramatic circumstances" had now been dealt with.

But the man’s legal troubles are not over. The 27-year-old is facing deportation back to Jamaica.

Brown says her client has lived here since the age of one, and didn't know he wasn't a Canadian citizen until he was 18 years old.

Justice Bondy says she did not consider the man’s citizenship when reaching her decision.

With files from The Canadian Press.