Hi Anirudh,

On 2026-07-19T18:03:31, Anirudh Srinivasan
<[email protected]> wrote:
> bios_emulator: use driver-model functions for PCI config acceses

Typo in the subject: 'accesses'.

>
> To allow BIOSEMU to build without CONFIG_DM_PCI_COMPAT, update the
> PCI config space read/write methods in BE_accessReg to use the
> dm_pci_read_config8/16/32 and dm_pci_write_config8/16/32 methods.
>
> Signed-off-by: Anirudh Srinivasan <[email protected]>
>
> drivers/bios_emulator/besys.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)

> diff --git a/drivers/bios_emulator/besys.c b/drivers/bios_emulator/besys.c
> @@ -435,27 +435,27 @@ static u32 BE_accessReg(int regOffset, u32 value, int 
> func)
>       if ((function == _BE_env.vgaInfo.function) &&
>           (device == _BE_env.vgaInfo.device) &&
>           (bus == _BE_env.vgaInfo.bus)) {
> -             pci_dev_t bdf = PCI_BDF(bus, device, function);
> +             struct udevice *dev = _BE_env.vgaInfo.pcidev;

With pcidev available, the bus/device/function fields in vgaInfo are
only used for this comparison. Cleaner to compare the udevice pointer
directly (or dm_pci_get_bdf(dev) against
dm_pci_get_bdf(_BE_env.vgaInfo.pcidev)) and drop those fields.
Follow-up, not required here.

Reviewed-by: Simon Glass <[email protected]>

Regards,
Simon

Reply via email to