This patch factors out the setting of PNP resources into one function which is then reused for all PNP resource types. This makes the code more concise and avoids duplication. The parameters "type" and "flags" are not used at themoment but will be used by follow-up patches. Placeholders for these patches can be found in the comment lines that contain the "TBD" marker.

As the code does not make any changes to the ABI, no regressions are expected.