Mortgages, trust deeds, or other instruments intended to secure the payment of an obligation affecting title to or an interest in real property shall not be deemed a conveyance, regardless of its terms, so as to enable the owner of the obligation secured to recover possession of real property without foreclosure and sale, but the same shall be deemed a lien.