Skip to contentSkip to conversation

Input: synaptics-rmi4 - fix the error return code in rmi_probe_interrupts()

PATCH Applied Lyude Paul 4 participants 6 messages Jun 7, 2018 – Apr 28, 2020

Subsystems (3)
lore
Share & tools
lore

Lyude Paul

author Reviewed-by
#0 lore raw
Quoted 29 lines · Wei Yongjun

The error return code PTR_ERR(data->irqdomain) is always 0 since data->irqdomain is equal to NULL in this error handling case.

Fixes 24d28e4f1271 ("Input: synaptics-rmi4 - convert irq distribution to

irq_domain")

---
 drivers/input/rmi4/rmi_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/rmi4/rmi_driver.c +1 -2
index 2fb0ae0..cb6d983 100644
@@ -1043,7 +1043,7 @@ int rmi_probe_interrupts(struct rmi_driver_data *data)
 						   data);
 	if (!data->irqdomain) {
 		dev_err(&rmi_dev->dev, "Failed to create IRQ domain\n");
-		return PTR_ERR(data->irqdomain);
+		return -ENOMEM;
 	}
 
 	data->irq_count = irq_count;
 
--

To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Cheers,
	Lyude Paul
#1 lore raw
Quoted 28 lines · Lyude Paul
Quoted 25 lines · Wei Yongjun

The error return code PTR_ERR(data->irqdomain) is always 0 since data->irqdomain is equal to NULL in this error handling case.

Fixes 24d28e4f1271 ("Input: synaptics-rmi4 - convert irq distribution to

irq_domain")

---
 drivers/input/rmi4/rmi_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/rmi4/rmi_driver.c +1 -1
index 2fb0ae0..cb6d983 100644
@@ -1043,7 +1043,7 @@ int rmi_probe_interrupts(struct rmi_driver_data *data)
                                                 data);
      if (!data->irqdomain) {
              dev_err(&rmi_dev->dev, "Failed to create IRQ domain\n");
-             return PTR_ERR(data->irqdomain);
+             return -ENOMEM;
      }
 
      data->irq_count = irq_count;
Quoted 7 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Cheers,
Lyude Paul

Reviewed-by
#2 lore raw
In reply to Lyude Paul
Quoted 37 lines · Nick Desaulniers
Quoted 28 lines · Lyude Paul
Quoted 25 lines · Wei Yongjun

The error return code PTR_ERR(data->irqdomain) is always 0 since data->irqdomain is equal to NULL in this error handling case.

Fixes 24d28e4f1271 ("Input: synaptics-rmi4 - convert irq distribution to

irq_domain")

---
 drivers/input/rmi4/rmi_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/rmi4/rmi_driver.c +1 -1
index 2fb0ae0..cb6d983 100644
@@ -1043,7 +1043,7 @@ int rmi_probe_interrupts(struct rmi_driver_data *data)
                                                 data);
      if (!data->irqdomain) {
              dev_err(&rmi_dev->dev, "Failed to create IRQ domain\n");
-             return PTR_ERR(data->irqdomain);
+             return -ENOMEM;
      }
 
      data->irq_count = irq_count;
Quoted 7 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Cheers,
Lyude Paul

Quoted 1 line

Sorry, that probably should have been a

hopefully that doesn't mess up any maintainers' automated scripts.

maintainer Applied
#3 lore raw
In reply to Lyude Paul
Quoted 39 lines · Nick Desaulniers
Quoted 37 lines · Nick Desaulniers
Quoted 35 lines · Lyude Paul
Quoted 26 lines · Wei Yongjun

The error return code PTR_ERR(data->irqdomain) is always 0 since data->irqdomain is equal to NULL in this error handling case.

Fixes 24d28e4f1271 ("Input: synaptics-rmi4 - convert irq distribution to

irq_domain")

---
 drivers/input/rmi4/rmi_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/rmi4/rmi_driver.c +1 -2
index 2fb0ae0..cb6d983 100644
@@ -1043,7 +1043,7 @@ int rmi_probe_interrupts(struct rmi_driver_data *data)
                                                 data);
      if (!data->irqdomain) {
              dev_err(&rmi_dev->dev, "Failed to create IRQ domain\n");
-             return PTR_ERR(data->irqdomain);
+             return -ENOMEM;
      }
 
      data->irq_count = irq_count;
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Cheers,
Lyude Paul

Quoted 7 lines
Quoted 1 line

Sorry, that probably should have been a

hopefully that doesn't mess up any maintainers' automated scripts.

Applied, thank you.

Signature · 1 line
Dmitry
#4 lore raw

PATCH 1/1 Input: synaptics-rmi4 - fix error return code in rmi_driver_probe()

In reply to Lyude Paul

Fix to return a negative error code from the input_register_device() error handling case instead of 0, as done elsewhere in this function.

---
 drivers/input/rmi4/rmi_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/rmi4/rmi_driver.c +2 -1
index 190b9974526b..bfc08d7b25d0 100644
@@ -1210,7 +1210,8 @@ static int rmi_driver_probe(struct device *dev)
 	if (data->input) {
 		rmi_driver_set_input_name(rmi_dev, data->input);
 		if (!rmi_dev->xport->input) {
-			if (input_register_device(data->input)) {
+			retval = input_register_device(data->input);
+			if (retval) {
 				dev_err(dev, "%s: Failed to register input device.\n",
 					__func__);
 				goto err_destroy_functions;
maintainer Applied
#5 lore raw

Re: [PATCH -next] Input: synaptics-rmi4 - fix error return code in rmi_driver_probe()

Quoted 4 lines · Wei Yongjun

Fix to return a negative error code from the input_register_device() error handling case instead of 0, as done elsewhere in this function.

Applied, thank you.

Quoted 21 lines
---
 drivers/input/rmi4/rmi_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/rmi4/rmi_driver.c +2 -1
index 190b9974526b..bfc08d7b25d0 100644
@@ -1210,7 +1210,8 @@ static int rmi_driver_probe(struct device *dev)
 	if (data->input) {
 		rmi_driver_set_input_name(rmi_dev, data->input);
 		if (!rmi_dev->xport->input) {
-			if (input_register_device(data->input)) {
+			retval = input_register_device(data->input);
+			if (retval) {
 				dev_err(dev, "%s: Failed to register input device.\n",
 					__func__);
 				goto err_destroy_functions;
Signature · 1 line
Dmitry