Mike did not recommend the approach used by the patch.
Your patch exposes a new pattern that's anti-driver-model, IMO.
If you want to avoid code duplication, solve that problem in a way that does not introduce such a pattern.
Please be aware that any one piece of code introduced in edk2, could be cloned to multiple similar pieces of code. So we need to be very careful.
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Borzeszkowski, Alan <alan.borzeszkowski@intel.com>
Sent: Wednesday, May 8, 2024 21:24
To: Ni, Ray <ray.ni@intel.com>; devel@edk2.groups.io <devel@edk2.groups.io>
Subject: Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: Load Serial driver in early DXE