File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ static int keywest_probe(struct i2c_client *client,
40
40
static int keywest_attach_adapter (struct i2c_adapter * adapter )
41
41
{
42
42
struct i2c_board_info info ;
43
+ struct i2c_client * client ;
43
44
44
45
if (! keywest_ctx )
45
46
return - EINVAL ;
@@ -50,9 +51,11 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
50
51
memset (& info , 0 , sizeof (struct i2c_board_info ));
51
52
strlcpy (info .type , "keywest" , I2C_NAME_SIZE );
52
53
info .addr = keywest_ctx -> addr ;
53
- keywest_ctx -> client = i2c_new_device (adapter , & info );
54
- if (!keywest_ctx -> client )
55
- return - ENODEV ;
54
+ client = i2c_new_client_device (adapter , & info );
55
+ if (IS_ERR (client ))
56
+ return PTR_ERR (client );
57
+ keywest_ctx -> client = client ;
58
+
56
59
/*
57
60
* We know the driver is already loaded, so the device should be
58
61
* already bound. If not it means binding failed, and then there
You can’t perform that action at this time.
0 commit comments