The shell variable $module has to be interpolated into the awk script, so the program can't be in single quotes. That means that any characters special to the shell must be protected with backslashes.
If the author preferred, the code could have been written like this:
major=$(awk -v module=$module '$2 == module { print $1 }' /proc/devices)
Testing the original code (after fixing up = = to ==, I get errors because of the double backslashes; they aren't necessary. Single backslashes would be sufficient, as in:
major=$(awk "\$2==\"$module\" {print \$1}" /proc/devices)
awkscript?