master/domain.c
changeset 410 3b8e94d623ab
parent 404 7f7f429e13c7
child 416 4f007cd2a79d
--- a/master/domain.c	Tue Oct 17 14:50:04 2006 +0000
+++ b/master/domain.c	Wed Oct 18 08:59:53 2006 +0000
@@ -439,16 +439,9 @@
 
     master = domain->master;
 
-    // translate address
+    // translate address and validate slave
     if (!(slave = ecrt_master_get_slave(master, address))) return NULL;
-
-    if (vendor_id != slave->sii_vendor_id ||
-        product_code != slave->sii_product_code) {
-        EC_ERR("Invalid slave type at position %i - Requested: 0x%08X 0x%08X,"
-               " found: 0x%08X 0x%08X\".\n", slave->ring_position, vendor_id,
-               product_code, slave->sii_vendor_id, slave->sii_product_code);
-        return NULL;
-    }
+    if (ec_slave_validate(slave, vendor_id, product_code)) return NULL;
 
     if (!data_ptr) {
         // data_ptr is NULL => mark slave as "registered" (do not warn)