[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210916153111.13780-1-caihuoqing@baidu.com>
Date: Thu, 16 Sep 2021 23:31:11 +0800
From: Cai Huoqing <caihuoqing@...du.com>
To: <caihuoqing@...du.com>
CC: Dmitry Torokhov <dmitry.torokhov@...il.com>,
<linux-input@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] Input: ams_delta_serio - Make use of the helper function dev_err_probe()
When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
Using dev_err_probe() can reduce code size, and the error value
gets printed.
Signed-off-by: Cai Huoqing <caihuoqing@...du.com>
---
drivers/input/serio/ams_delta_serio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c
index 1c0be299f179..9963f336e253 100644
--- a/drivers/input/serio/ams_delta_serio.c
+++ b/drivers/input/serio/ams_delta_serio.c
@@ -121,8 +121,8 @@ static int ams_delta_serio_init(struct platform_device *pdev)
priv->vcc = devm_regulator_get(&pdev->dev, "vcc");
if (IS_ERR(priv->vcc)) {
- err = PTR_ERR(priv->vcc);
- dev_err(&pdev->dev, "regulator request failed (%d)\n", err);
+ err = dev_err_probe(&pdev->dev, PTR_ERR(priv->vcc),
+ "regulator request failed\n");
/*
* When running on a non-dt platform and requested regulator
* is not available, devm_regulator_get() never returns
--
2.25.1
Powered by blists - more mailing lists