diff options
Diffstat (limited to 'Documentation/i2c/upgrading-clients')
-rw-r--r-- | Documentation/i2c/upgrading-clients | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/i2c/upgrading-clients b/Documentation/i2c/upgrading-clients index ccba3ffd6e80..96392cc5b5c7 100644 --- a/Documentation/i2c/upgrading-clients +++ b/Documentation/i2c/upgrading-clients | |||
@@ -43,7 +43,7 @@ static int example_attach(struct i2c_adapter *adap, int addr, int kind) | |||
43 | example->client.adapter = adap; | 43 | example->client.adapter = adap; |
44 | 44 | ||
45 | i2c_set_clientdata(&state->i2c_client, state); | 45 | i2c_set_clientdata(&state->i2c_client, state); |
46 | strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE); | 46 | strscpy(client->i2c_client.name, "example", sizeof(client->i2c_client.name)); |
47 | 47 | ||
48 | ret = i2c_attach_client(&state->i2c_client); | 48 | ret = i2c_attach_client(&state->i2c_client); |
49 | if (ret < 0) { | 49 | if (ret < 0) { |
@@ -138,7 +138,7 @@ can be removed: | |||
138 | - example->client.flags = 0; | 138 | - example->client.flags = 0; |
139 | - example->client.adapter = adap; | 139 | - example->client.adapter = adap; |
140 | - | 140 | - |
141 | - strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE); | 141 | - strscpy(client->i2c_client.name, "example", sizeof(client->i2c_client.name)); |
142 | 142 | ||
143 | The i2c_set_clientdata is now: | 143 | The i2c_set_clientdata is now: |
144 | 144 | ||