net: phy: sfp: clean up a condition
Subsystems (5)
PATCH 1/1 net: phy: sfp: clean up a condition
The acpi_node_get_property_reference() doesn't return ACPI error codes, it just returns regular negative kernel error codes. This patch doesn't affect run time, it's just a clean up.
--- drivers/net/phy/sfp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/sfp.c +1 -1
@@ -1848,7 +1848,7 @@ static int sfp_probe(struct platform_device *pdev)int ret; ret =acpi_node_get_property_reference (fw,"i2c-bus" ,0 , &args); -if (ACPI_FAILURE (ret) || !is_acpi_device_node (args.fwnode)) { +if (ret || !is_acpi_device_node (args.fwnode)) {dev_err (&pdev->dev,"missing 'i2c-bus' property\n" );return -ENODEV ; }
Signature · 1 line
2.20.1
Quoted 6 lines · Dan Carpenter
The
acpi_node_get_property_reference()doesn't return ACPI error codes, it just returns regular negative kernel error codes. This patch doesn't affect run time, it's just a clean up.Signed-off-by Dan Carpenter <[email protected]>---
Russell King - ARM Linux admin
maintainerQuoted 14 lines · Dan Carpenter
The
acpi_node_get_property_reference()doesn't return ACPI error codes, it just returns regular negative kernel error codes. This patch doesn't affect run time, it's just a clean up.Signed-off-by Dan Carpenter <[email protected]>--- drivers/net/phy/sfp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/phy/sfp.c +0
-0
drivers/net/phy/sfp.c static int sfp_probe(struct platform_device *pdev) · line 1853
Quoted 7 lines
drivers/net/phy/sfp.c +1
-1@@ -1848,7 +1848,7 @@ static int sfp_probe(struct platform_device *pdev)int ret; ret =acpi_node_get_property_reference (fw,"i2c-bus" ,0 , &args); -if (ACPI_FAILURE (ret) || !is_acpi_device_node (args.fwnode)) { +if (ret || !is_acpi_device_node (args.fwnode)) {dev_err (&pdev->dev,"missing 'i2c-bus' property\n" );return -ENODEV ;
If "ret" is a Linux error code, should we print its value when reporting the error so we know why the failure occurred, and propagate the error code?
Quoted 5 lines
drivers/net/phy/sfp.c +0
-0}Signature · 1 line
2.20.1
Signature · 3 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up
Quoted 17 lines · Russell King - ARM Linux admin
Quoted 16 lines · Dan Carpenter
The
acpi_node_get_property_reference()doesn't return ACPI error codes, it just returns regular negative kernel error codes. This patch doesn't affect run time, it's just a clean up.Signed-off-by Dan Carpenter <[email protected]>--- drivers/net/phy/sfp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/phy/sfp.c +0
-0@@ -1848,7 +1848,7 @@ static int sfp_probe(struct platform_device *pdev)int ret;
Quoted 9 lines
drivers/net/phy/sfp.c static int sfp_probe(struct platform_device *pdev) · line 1853
Quoted 5 lines
drivers/net/phy/sfp.c +1
-1ret =acpi_node_get_property_reference (fw,"i2c-bus" ,0 , &args); -if (ACPI_FAILURE (ret) || !is_acpi_device_node (args.fwnode)) { +if (ret || !is_acpi_device_node (args.fwnode)) {dev_err (&pdev->dev,"missing 'i2c-bus' property\n" );return -ENODEV ;If "ret" is a Linux error code, should we print its value when reporting the error so we know why the failure occurred, and propagate the error code?
We can't propagate the error code because we might have failed because acpi_node_get_property_reference() succeeded but it's not a device node.
regards,
dan carpenter
From: Dan Carpenter <[email protected]>
Date: Thu, 13 Jun 2019 09:51:02 +0300
Quoted 5 lines
The
acpi_node_get_property_reference()doesn't return ACPI error codes, it just returns regular negative kernel error codes. This patch doesn't affect run time, it's just a clean up.Signed-off-by Dan Carpenter <[email protected]>
Applied to net-next.
Quoted 10 lines · David Miller
From: Dan Carpenter <[email protected]>
Date: Thu, 13 Jun 2019 09:51:02 +0300Quoted 5 lines
The
acpi_node_get_property_reference()doesn't return ACPI error codes, it just returns regular negative kernel error codes. This patch doesn't affect run time, it's just a clean up.Signed-off-by Dan Carpenter <[email protected]>Applied to net-next.
I meant to say net-next but I made a typo. :/
regards,
dan carpenter