The Messenger of Allah ﷺ used to go to the Mosque of Quba both riding and on foot.
حدثنا عبد الرزاق أخبرنا سفيان عن عبد الله بن دينار
كان رسول الله ﷺ يأتي مسجد قباء راكبا وماشيا
Its isnad is sahih, and it is a repetition of 5403.