phy: qcom-qmp-pcie: add config sanity checks
authorJohan Hovold <johan+linaro@kernel.org>
Wed, 12 Oct 2022 08:49:59 +0000 (10:49 +0200)
committerVinod Koul <vkoul@kernel.org>
Fri, 28 Oct 2022 12:25:05 +0000 (17:55 +0530)
The driver expects every configuration to set the pwrdn_ctrl and
phy_status masks. Add some probe WARN_ON_ONCE() to probe to catch any
new driver support that fails to provide them.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20221012085002.24099-17-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c

index 5534a4ad02435394dab3090b457bf53ce40e3f90..7c81667dd968038d271bea0f64b32b3c6d0288f0 100644 (file)
@@ -2347,6 +2347,9 @@ static int qmp_pcie_probe(struct platform_device *pdev)
        if (!cfg)
                return -EINVAL;
 
+       WARN_ON_ONCE(!cfg->pwrdn_ctrl);
+       WARN_ON_ONCE(!cfg->phy_status);
+
        serdes = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(serdes))
                return PTR_ERR(serdes);