[PATCH] Input: ams_delta_serio - Make use of the helper function dev_err_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux