@@ -34,7 +34,7 @@ struct cht_int33fe_data {
3434 struct i2c_client * fusb302 ;
3535 struct i2c_client * pi3usb30532 ;
3636 /* Contain a list-head must be per device */
37- struct device_connection connections [3 ];
37+ struct device_connection connections [4 ];
3838};
3939
4040/*
@@ -184,9 +184,7 @@ static int cht_int33fe_probe(struct i2c_client *client)
184184 data -> connections [2 ].endpoint [1 ] = "intel_xhci_usb_sw-role-switch" ;
185185 data -> connections [2 ].id = "usb-role-switch" ;
186186
187- device_connection_add (& data -> connections [0 ]);
188- device_connection_add (& data -> connections [1 ]);
189- device_connection_add (& data -> connections [2 ]);
187+ device_connections_add (data -> connections );
190188
191189 memset (& board_info , 0 , sizeof (board_info ));
192190 strlcpy (board_info .type , "typec_fusb302" , I2C_NAME_SIZE );
@@ -217,9 +215,7 @@ static int cht_int33fe_probe(struct i2c_client *client)
217215 if (data -> max17047 )
218216 i2c_unregister_device (data -> max17047 );
219217
220- device_connection_remove (& data -> connections [2 ]);
221- device_connection_remove (& data -> connections [1 ]);
222- device_connection_remove (& data -> connections [0 ]);
218+ device_connections_remove (data -> connections );
223219
224220 return - EPROBE_DEFER ; /* Wait for the i2c-adapter to load */
225221}
@@ -233,9 +229,7 @@ static int cht_int33fe_remove(struct i2c_client *i2c)
233229 if (data -> max17047 )
234230 i2c_unregister_device (data -> max17047 );
235231
236- device_connection_remove (& data -> connections [2 ]);
237- device_connection_remove (& data -> connections [1 ]);
238- device_connection_remove (& data -> connections [0 ]);
232+ device_connections_remove (data -> connections );
239233
240234 return 0 ;
241235}
0 commit comments