Skip to content

Commit c7afada

Browse files
Mani-Sadhasivammartinkpetersen
authored andcommitted
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: Andrew Halaney <ahalaney@redhat.com> Signed-off-by: Manivannan 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: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 8291652 commit c7afada

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/ufs/host/ufs-qcom.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,9 +1148,8 @@ static int ufs_qcom_init(struct ufs_hba *hba)
11481148
host->device_reset = devm_gpiod_get_optional(dev, "reset",
11491149
GPIOD_OUT_HIGH);
11501150
if (IS_ERR(host->device_reset)) {
1151-
err = PTR_ERR(host->device_reset);
1152-
if (err != -EPROBE_DEFER)
1153-
dev_err(dev, "failed to acquire reset gpio: %d\n", err);
1151+
err = dev_err_probe(dev, PTR_ERR(host->device_reset),
1152+
"Failed to acquire device reset gpio\n");
11541153
goto out_variant_clear;
11551154
}
11561155

0 commit comments

Comments
 (0)