(a) If it appears that the property taken is not the same as that described in a search warrant or that there is no probable cause for believing the existence of the ground on which the warrant issued, the judge or the magistrate must direct it to be restored to the person from whom it was taken.
(b) If the property is not directed to be restored under the provisions of subsection (a) of this section, the judge or the magistrate shall annex together the search warrant, the return and the depositions and return them to the court having power to inquire into the offense in respect to which the search warrant was issued.