On Tue, 4 Feb 2025 at 09:21, Bernhard Beschow <[email protected]> wrote:
>
> Linux checks for the PLLs in the PHY to be locked, so implement a model
> emulating that.
>
> Signed-off-by: Bernhard Beschow <[email protected]>
> ---

> +static const VMStateDescription fsl_imx8m_pcie_phy_vmstate = {
> +    .name = "fsl-imx8m-pcie-phy",
> +    .version_id = 1,
> +    .minimum_version_id = 1,
> +    .fields = (const VMStateField[]) {
> +        VMSTATE_UINT8_ARRAY(data, FslImx8mPciePhyState,
> +                            ARRAY_SIZE(((FslImx8mPciePhyState 
> *)NULL)->data)),

Use a defined constant for the number of array elements, please.
We don't do this thing with ARRAY_SIZE of a cast NULL pointer
anywhere else in the codebase.

> +        VMSTATE_END_OF_LIST()
> +    }
> +};
> +
> +static void fsl_imx8m_pcie_phy_class_init(ObjectClass *klass, void *data)
> +{
> +    DeviceClass *dc = DEVICE_CLASS(klass);
> +
> +    dc->realize = fsl_imx8m_pcie_phy_realize;
> +    dc->vmsd = &fsl_imx8m_pcie_phy_vmstate;
> +}

This is missing the reset method.

thanks
-- PMM

Reply via email to