212 EC_CONFIG_DBG(sc, 1, "Failed to attach configuration. Slave %u" |
212 EC_CONFIG_DBG(sc, 1, "Failed to attach configuration. Slave %u" |
213 " already has a configuration!\n", slave->ring_position); |
213 " already has a configuration!\n", slave->ring_position); |
214 return -EEXIST; |
214 return -EEXIST; |
215 } |
215 } |
216 |
216 |
217 if (slave->sii.vendor_id != sc->vendor_id |
217 if ( |
218 || slave->sii.product_code != sc->product_code) { |
218 #ifdef EC_IDENT_WILDCARDS |
219 EC_CONFIG_DBG(sc, 1, "Slave %u has an invalid type (0x%08X/0x%08X)" |
219 sc->vendor_id != 0xffffffff && |
220 " for configuration (0x%08X/0x%08X).\n", |
220 #endif |
221 slave->ring_position, slave->sii.vendor_id, |
221 slave->sii.vendor_id != sc->vendor_id |
222 slave->sii.product_code, sc->vendor_id, sc->product_code); |
222 ) { |
|
223 EC_CONFIG_DBG(sc, 1, "Slave %u has no matching vendor ID (0x%08X)" |
|
224 " for configuration (0x%08X).\n", |
|
225 slave->ring_position, slave->sii.vendor_id, sc->vendor_id); |
|
226 return -EINVAL; |
|
227 } |
|
228 |
|
229 if ( |
|
230 #ifdef EC_IDENT_WILDCARDS |
|
231 sc->product_code != 0xffffffff && |
|
232 #endif |
|
233 slave->sii.product_code != sc->product_code |
|
234 ) { |
|
235 EC_CONFIG_DBG(sc, 1, "Slave %u has no matching product code (0x%08X)" |
|
236 " for configuration (0x%08X).\n", |
|
237 slave->ring_position, slave->sii.product_code, |
|
238 sc->product_code); |
223 return -EINVAL; |
239 return -EINVAL; |
224 } |
240 } |
225 |
241 |
226 // attach slave |
242 // attach slave |
227 slave->config = sc; |
243 slave->config = sc; |