Skip to contentSkip to conversation

drivers: net: xgene: Add backward compatibility

bug report Dan Carpenter 1 participant 1 message Aug 3, 2016 ACPI

lore
Share & tools
lore
#0 lore raw

Hello Iyappan Subramanian,

The patch 8089a96f601b: "drivers: net: xgene: Add backward compatibility" from Jul 25, 2016, leads to the following static checker warning:

drivers/net/ethernet/apm/xgene/xgene_enet_hw.c:744 acpi_phy_find_device()
warn: passing negative value to 'ACPI_FAILURE((-71))'

drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
735 static struct acpi_device *acpi_phy_find_device(struct device *dev) 736 {

   737          struct acpi_reference_args args;
   738          struct fwnode_handle *fw_node;
   739          int status;

740
741 fw_node = acpi_fwnode_handle(ACPI_COMPANION(dev));
742 status = acpi_node_get_property_reference(fw_node, "phy-handle", 0,
743 &args);

acpi_node_get_property_reference() returns normal kernel error codes, not ACPI error codes. It doesn't cause a runtime problem but it's probably should just be "if (status) {".

744 if (ACPI_FAILURE(status)) {
745 dev_dbg(dev, "No matching phy in ACPI table\n");
746 return NULL;
747 }
748
749 return args.adev;
750 }

regards,
dan carpenter