Joselu joined Espanyol after suffering relegation with Alaves last season but included a clause in his contract which would allow him to move on loan to another club if Espanyol were relegated.
The 33-year-old striker played for Castilla between 2010 and 2012, winning promotion to the second division in his second season at the club. He also made his first-team debut under Jose Mourinho that season and scored in an 8-1 victory over Almeria.
Madrid could also look to bolster their attacking options this summer with ESPN reporting that Karim Benzema is mulling his future after receiving a million-dollar offer from Saudi Arabia.
Madrid have already signed Fran Garcia to bolster their left-back position but a busy summer is expected at the club after a disappointing end to the season in which they failed to compete in LaLiga with Barça and were knocked out of the Champions League by Manchester City.