Moves all the duplicate code to a single function.

Verify for invalid modes and unwanted flags before pass the new flags to
driver.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@274670 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make gpio_default_map_gpios() static.  No functional changes.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@274671 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f