(a) If a restriction that affects real property, or a provision in a deed that conveys real property or an interest in real property, whether express or incorporated by reference, prohibits the use by or the sale, lease, or transfer to a person because of race, color, religion, or national origin, the provision or restriction is void.
(b) A court shall dismiss a suit or part of a suit to enforce a provision that is void under this section.