Re: [PATCH v1 6/8] phy: qcom-qmp: Utilize UFS reset controller

From: Stephen Boyd
Date: Fri Jan 18 2019 - 17:33:37 EST


Quoting Evan Green (2019-01-11 15:01:27)
> @@ -1214,6 +1225,32 @@ static int qcom_qmp_phy_init(struct phy *phy)
>
> dev_vdbg(qmp->dev, "Initializing QMP phy\n");
>
> + if (cfg->has_ufsphy_reset) {
> + /*
> + * Get UFS reset, which is delayed until now to avoid a
> + * circular dependency where UFS needs its PHY, but the PHY
> + * needs this UFS reset.
> + */
> + if (!qmp->ufs_reset) {
> + qmp->ufs_reset = of_reset_control_get(qmp->dev->of_node,

Can you use devm_reset_control_get()? Put another way, why is this DT
specific instead of using a firmware/platform agnostic API?

> + "ufsphy");
> +
> + if (IS_ERR(qmp->ufs_reset)) {
> + dev_err(qmp->dev,
> + "failed to get UFS reset: %d\n",
> + PTR_ERR(qmp->ufs_reset));
> +
> + return PTR_ERR(qmp->ufs_reset);
> + }
> + }
> +
> + ret = reset_control_assert(qmp->ufs_reset);
> + if (ret) {
> + dev_err(qmp->dev, "ufsphy reset deassert failed\n");

It's an assert though. Maybe just ignore the error message because the
user won't be able to do anything anyway?