When the Messenger was raised as a Prophet, such racism was prevalent in Makka in the guise of tribalism. The Quraysh considered themselves (in particular) and Arabs (in general) superior to all other people. The Messenger came with the Divine Message and proclaimed that: "No Arab is superior to a non-Arab, and no white person is superior to a black person";  Superiority is by righteousness and devotion to God alone (49:13); and: "Even if a black Abyssinian Muslim were to rule over Muslims, he should be obeyed." 
The Messenger eradicated color-based racism and discrimination so successfully that, for example, 'Umar once said of Bilal, who was black: "Bilal is our master, and was emancipated by our master Abu Bakr."  Zayd ibn Haritha, a black slave emancipated by the Messenger, was his adopted son before the Revelation banned such adoption. The Prophet married him to Zaynab bint Jahsh, one of the noblest (and non-black) Arab and Muslim women. In addition, he appointed Zayd commander of the Muslim army sent against the Byzantine Empire, even though it included such leading Companions as Abu Bakr, 'Umar, Ja'far ibn Abu Talib (the Messenger's cousin), and Khalid ibn Walid (the invincible general of the age).  The Prophet appointed Zayd's son Usama to command the army he formed just before his death. Included therein were such leading Companions as Abu Bakr, 'Umar, Khalid, Abu 'Ubayda, Talha, and Zubayr. This established in the Muslims' hearts and minds that superiority is not by birth or color or blood, but by righteousness and devotion to God.
During his caliphate, 'Umar paid Usama a higher salary than his own son, 'Abd Allah. When his son asked why, 'Umar replied: "My son, I do so because I know the Messenger loved Usama's father more than me, and Usama more than you." 
 Muslim, " 'Imara," 37.
 Ibn Hajar, al-Isaba, 1:165.
 Muslim, "Fada'il al-Sahaba," 63.
 Ibn Sa'd, Tabaqat, 4:70; Ibn Hajar, 1:564.