[PATCH v2] tty: serial: Replace -ENOMEM with -ENOSPC
From: Xichao Zhao
Date: Tue Aug 19 2025 - 07:15:52 EST
The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
And using -ENOSPC here is more appropriate. So replace -ENOMEM
with -ENOSPC.
Signed-off-by: Xichao Zhao <zhao.xichao@xxxxxxxx>
---
drivers/tty/serial/max3100.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index 67d80f8f801e..3faa1b6aa3ee 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -705,7 +705,7 @@ static int max3100_probe(struct spi_device *spi)
break;
if (i == MAX_MAX3100) {
mutex_unlock(&max3100s_lock);
- return dev_err_probe(dev, -ENOMEM, "too many MAX3100 chips\n");
+ return dev_err_probe(dev, -ENOSPC, "too many MAX3100 chips\n");
}
max3100s[i] = kzalloc(sizeof(struct max3100_port), GFP_KERNEL);
--
2.34.1