`find /sys/* -maxdepth 2 -depth -type d -exec mountpoint -q {} \; -exec umount {} \;` may be the way to go.