Do we want to abort? We are in loop scanning for devices so makes senseYes, I agree it will be mandatory in such cases.+int sdw_of_find_slaves(struct sdw_bus *bus)I am confused here.
+{
+ÂÂÂ struct device *dev = bus->dev;
+ÂÂÂ struct device_node *node;
+
+ÂÂÂ for_each_child_of_node(bus->dev->of_node, node) {
+ÂÂÂÂÂÂÂ struct sdw_slave_id id;
+ÂÂÂÂÂÂÂ const char *compat = NULL;
+ÂÂÂÂÂÂÂ int unique_id, ret;
+ÂÂÂÂÂÂÂ int ver, mfg_id, part_id, class_id;
+
+ÂÂÂÂÂÂÂ compat = of_get_property(node, "compatible", NULL);
+ÂÂÂÂÂÂÂ if (!compat)
+ÂÂÂÂÂÂÂÂÂÂÂ continue;
+
+ÂÂÂÂÂÂÂ ret = sscanf(compat, "sdw%x,%x,%x,%x",
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ &ver, &mfg_id, &part_id, &class_id);
+ÂÂÂÂÂÂÂ if (ret != 4) {
+ÂÂÂÂÂÂÂÂÂÂÂ dev_err(dev, "Manf ID & Product code not found %s\n",
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ compat);
+ÂÂÂÂÂÂÂÂÂÂÂ continue;
+ÂÂÂÂÂÂÂ }
+
+ÂÂÂÂÂÂÂ ret = of_property_read_u32(node, "sdw-instance-id", &unique_id);
+ÂÂÂÂÂÂÂ if (ret) {
+ÂÂÂÂÂÂÂÂÂÂÂ dev_err(dev, "Instance id not found:%d\n", ret);
+ÂÂÂÂÂÂÂÂÂÂÂ continue;
If you have two identical devices on the same link, isn't this property
required and that should be a real error instead of a continue?
Am okay either way, I dont mind changing it to returning EINVAL in all the
cases.
if we do not do that and continue to check next one..