mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
hwmon: (lm83) Replace new_client with client
It has no value to name a variable 'new_client' in probe and detect functions; it is obvious that the client is new. Use 'client' as variable name instead. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
11e3377b9a
commit
81de0eea2b
1 changed files with 14 additions and 14 deletions
|
@ -272,10 +272,10 @@ static const struct attribute_group lm83_group_opt = {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Return 0 if detection is successful, -ENODEV otherwise */
|
/* Return 0 if detection is successful, -ENODEV otherwise */
|
||||||
static int lm83_detect(struct i2c_client *new_client,
|
static int lm83_detect(struct i2c_client *client,
|
||||||
struct i2c_board_info *info)
|
struct i2c_board_info *info)
|
||||||
{
|
{
|
||||||
struct i2c_adapter *adapter = new_client->adapter;
|
struct i2c_adapter *adapter = client->adapter;
|
||||||
const char *name;
|
const char *name;
|
||||||
u8 man_id, chip_id;
|
u8 man_id, chip_id;
|
||||||
|
|
||||||
|
@ -283,20 +283,20 @@ static int lm83_detect(struct i2c_client *new_client,
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
/* Detection */
|
/* Detection */
|
||||||
if ((i2c_smbus_read_byte_data(new_client, LM83_REG_R_STATUS1) & 0xA8) ||
|
if ((i2c_smbus_read_byte_data(client, LM83_REG_R_STATUS1) & 0xA8) ||
|
||||||
(i2c_smbus_read_byte_data(new_client, LM83_REG_R_STATUS2) & 0x48) ||
|
(i2c_smbus_read_byte_data(client, LM83_REG_R_STATUS2) & 0x48) ||
|
||||||
(i2c_smbus_read_byte_data(new_client, LM83_REG_R_CONFIG) & 0x41)) {
|
(i2c_smbus_read_byte_data(client, LM83_REG_R_CONFIG) & 0x41)) {
|
||||||
dev_dbg(&adapter->dev, "LM83 detection failed at 0x%02x\n",
|
dev_dbg(&adapter->dev, "LM83 detection failed at 0x%02x\n",
|
||||||
new_client->addr);
|
client->addr);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Identification */
|
/* Identification */
|
||||||
man_id = i2c_smbus_read_byte_data(new_client, LM83_REG_R_MAN_ID);
|
man_id = i2c_smbus_read_byte_data(client, LM83_REG_R_MAN_ID);
|
||||||
if (man_id != 0x01) /* National Semiconductor */
|
if (man_id != 0x01) /* National Semiconductor */
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
chip_id = i2c_smbus_read_byte_data(new_client, LM83_REG_R_CHIP_ID);
|
chip_id = i2c_smbus_read_byte_data(client, LM83_REG_R_CHIP_ID);
|
||||||
switch (chip_id) {
|
switch (chip_id) {
|
||||||
case 0x03:
|
case 0x03:
|
||||||
name = "lm83";
|
name = "lm83";
|
||||||
|
@ -324,17 +324,17 @@ static const struct i2c_device_id lm83_id[] = {
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(i2c, lm83_id);
|
MODULE_DEVICE_TABLE(i2c, lm83_id);
|
||||||
|
|
||||||
static int lm83_probe(struct i2c_client *new_client)
|
static int lm83_probe(struct i2c_client *client)
|
||||||
{
|
{
|
||||||
struct device *hwmon_dev;
|
struct device *hwmon_dev;
|
||||||
struct lm83_data *data;
|
struct lm83_data *data;
|
||||||
|
|
||||||
data = devm_kzalloc(&new_client->dev, sizeof(struct lm83_data),
|
data = devm_kzalloc(&client->dev, sizeof(struct lm83_data),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!data)
|
if (!data)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
data->client = new_client;
|
data->client = client;
|
||||||
mutex_init(&data->update_lock);
|
mutex_init(&data->update_lock);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -344,11 +344,11 @@ static int lm83_probe(struct i2c_client *new_client)
|
||||||
* declare 1 and 3 common, and then 2 and 4 only for the LM83.
|
* declare 1 and 3 common, and then 2 and 4 only for the LM83.
|
||||||
*/
|
*/
|
||||||
data->groups[0] = &lm83_group;
|
data->groups[0] = &lm83_group;
|
||||||
if (i2c_match_id(lm83_id, new_client)->driver_data == lm83)
|
if (i2c_match_id(lm83_id, client)->driver_data == lm83)
|
||||||
data->groups[1] = &lm83_group_opt;
|
data->groups[1] = &lm83_group_opt;
|
||||||
|
|
||||||
hwmon_dev = devm_hwmon_device_register_with_groups(&new_client->dev,
|
hwmon_dev = devm_hwmon_device_register_with_groups(&client->dev,
|
||||||
new_client->name,
|
client->name,
|
||||||
data, data->groups);
|
data, data->groups);
|
||||||
return PTR_ERR_OR_ZERO(hwmon_dev);
|
return PTR_ERR_OR_ZERO(hwmon_dev);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue