[PATCH] Input: atmel_mxt_ts - Make use of the helper function dev_err_probe()
From: Cai Huoqing
Date: Thu Sep 16 2021 - 11:31:29 EST
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/touchscreen/atmel_mxt_ts.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 05de92c0293b..36e8365238a4 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -3101,11 +3101,9 @@ static int mxt_parse_device_properties(struct mxt_data *data)
error = device_property_read_u32_array(dev, keymap_property,
keymap, n_keys);
- if (error) {
- dev_err(dev, "failed to parse '%s' property: %d\n",
- keymap_property, error);
- return error;
- }
+ if (error)
+ return dev_err_probe(dev, error,
+ "failed to parse '%s'\n", keymap_property);
data->t19_keymap = keymap;
data->t19_num_keys = n_keys;
--
2.25.1