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 56.
From that time this god became famous in the world by the name Susvapneshvara, the destroyer of all bad dreams.
Simple meaning: From then the god was famous as Susvapneshvara, who destroys all bad dreams.
इत्युक्तो गुरुणा भूयो वशिष्ठेन महात्मना ।
The king went to Mahakala forest and saw the linga that destroys bad dreams.
नष्टाः सर्वेपि दुःस्वप्नाः सुस्वप्नाश्चाभवंस्तदा ।
His bad dreams ended, and the king went back to Ayodhya and ruled happily.
अष्टम्यां च चतुर्दश्यां देवं स्वप्नेश्वरं शिवम् ।
Seeing Svapneshvara after a bath in the Shipra on the 8th or 14th is said to end bad dreams.