Try disconnecting the battery for about an hour. This resets the computer. After you reconnect the battery, plug the switch back in.
I had to do the same several months ago. My light would stay on so I just unplugged it, no real issue with the brakes. Put a new EGR valve on and the computer "thought" it was still the old one and it was still bad. Hooked the negative cable back up after a while and all was fine. About a month later plugged the brake light plug back in and badabing.....works like it's supposed to.