Purana Jyotisha Sangraha · by Vyasa
Chapter 14 · Ujjain: Shani and the Planet Tirthas
स्कन्दपुराणम् : अवन्त्यां शनिः ग्रहतीर्थानि च
नष्टाः सर्वेपि दुःस्वप्नाः सुस्वप्नाश्चाभवंस्तदा ।राजा निष्कलमषो भूत्वा पुनः प्राप्नोन्निजं पदम् ।अयोध्यायां गतो राज्यं चकार मुदितस्तदा ॥ ५५ ॥
From the Skanda Purana, print Avantya Khanda, Chaturashiti-linga-mahatmya ch 80, verse 55.
All his bad dreams were destroyed and became good dreams. The king, free of stain, got back his own place. Going to Ayodhya, he ruled the kingdom happily.
Simple meaning: His bad dreams ended, and the king went back to Ayodhya and ruled happily.
इत्युक्तो गुरुणा भूयो वशिष्ठेन महात्मना ।
The king went to Mahakala forest and saw the linga that destroys bad dreams.
तदाप्रभृति देवोऽयं सुस्वप्नेश्वरसंज्ञकः ।
From then the god was famous as Susvapneshvara, who destroys all bad dreams.
अष्टम्यां च चतुर्दश्यां देवं स्वप्नेश्वरं शिवम् ।
Seeing Svapneshvara after a bath in the Shipra on the 8th or 14th is said to end bad dreams.