Mishkat al-Masabih 3277
Ibn ‘Abbas said:
One makes atonement for something he has made unlawful for himself.* You have had a good example in God’s Messenger. 
* i.e. something not in itself unlawful. It is treated like an oath for breaking which atonement must be made. The Prophet’s example refers to his withdrawing from his wives for a period.

(Bukhari and Muslim.)
وَعَنِ ابْنِ عَبَّاسٍ قَالَ: فِي الْحَرَامِ يُكَفَّرُ لَقَدْ كَانَ لَكُمْ فِي رَسُولِ الله أُسْوَة حَسَنَة