Commit c7afadac authored by Manivannan Sadhasivam's avatar Manivannan Sadhasivam Committed by Martin K. Petersen

scsi: ufs: qcom: Use dev_err_probe() to simplify error handling of devm_gpiod_get_optional()

As done in other places, let's use dev_err_probe() to simplify the error
handling while acquiring the device reset gpio using
devm_gpiod_get_optional().

While at it, let's reword the error message to make it clear that the
failure is due to acquiring "device reset gpio".
Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
Signed-off-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20231208065902.11006-11-manivannan.sadhasivam@linaro.org
Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8775p-ride
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 8291652e
...@@ -1148,9 +1148,8 @@ static int ufs_qcom_init(struct ufs_hba *hba) ...@@ -1148,9 +1148,8 @@ static int ufs_qcom_init(struct ufs_hba *hba)
host->device_reset = devm_gpiod_get_optional(dev, "reset", host->device_reset = devm_gpiod_get_optional(dev, "reset",
GPIOD_OUT_HIGH); GPIOD_OUT_HIGH);
if (IS_ERR(host->device_reset)) { if (IS_ERR(host->device_reset)) {
err = PTR_ERR(host->device_reset); err = dev_err_probe(dev, PTR_ERR(host->device_reset),
if (err != -EPROBE_DEFER) "Failed to acquire device reset gpio\n");
dev_err(dev, "failed to acquire reset gpio: %d\n", err);
goto out_variant_clear; goto out_variant_clear;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment