Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: accel: msa311: Remove dev_err_probe() if error is -ENOMEM

The dev_err_probe() doesn't do anything when the error is '-ENOMEM'.
Therefore, remove the useless call to dev_err_probe(), and just return the
value instead.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20250821080723.525379-2-zhao.xichao@vivo.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Xichao Zhao and committed by
Jonathan Cameron
666a22bb 3f33d153

+3 -5
+3 -5
drivers/iio/accel/msa311.c
··· 990 990 msa311->chip_name = devm_kasprintf(dev, GFP_KERNEL, 991 991 "msa311-%02x", partid); 992 992 if (!msa311->chip_name) 993 - return dev_err_probe(dev, -ENOMEM, "can't alloc chip name\n"); 993 + return -ENOMEM; 994 994 995 995 return 0; 996 996 } ··· 1069 1069 1070 1070 trig = devm_iio_trigger_alloc(dev, "%s-new-data", msa311->chip_name); 1071 1071 if (!trig) 1072 - return dev_err_probe(dev, -ENOMEM, 1073 - "can't allocate newdata trigger\n"); 1072 + return -ENOMEM; 1074 1073 1075 1074 msa311->new_data_trig = trig; 1076 1075 msa311->new_data_trig->ops = &msa311_new_data_trig_ops; ··· 1152 1153 1153 1154 indio_dev = devm_iio_device_alloc(dev, sizeof(*msa311)); 1154 1155 if (!indio_dev) 1155 - return dev_err_probe(dev, -ENOMEM, 1156 - "IIO device allocation failed\n"); 1156 + return -ENOMEM; 1157 1157 1158 1158 msa311 = iio_priv(indio_dev); 1159 1159 msa311->dev = dev;