summaryrefslogtreecommitdiff
path: root/drivers/i2c/chips/pca9539.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-15 18:16:05 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-15 18:16:05 (GMT)
commitdc221eae08eea3b0db127d1f152fac24d10b6a52 (patch)
treeeea4cc64f2568db6aea94b9491120525ebcd738f /drivers/i2c/chips/pca9539.c
parent98339cbd360b77c3167db287fd611468c2c44559 (diff)
parent4735c98f8447acb1c8977e2b8024640f7bf36dd6 (diff)
downloadlinux-fsl-qoriq-dc221eae08eea3b0db127d1f152fac24d10b6a52.tar.xz
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: (56 commits) i2c: Add detection capability to new-style drivers i2c: Call client_unregister for new-style devices too i2c: Clean up old chip drivers i2c-ibm_iic: Register child nodes i2c: New-style EEPROM driver using device IDs i2c: Export the i2c_bus_type symbol i2c-au1550: Fix PM support i2c-dev: Delete empty detach_client callback i2c: Drop stray references to lm_sensors i2c: Check for ACPI resource conflicts i2c-ocores: basic PM support i2c-sibyte: SWARM I2C board initialization i2c-i801: Fix handling of error conditions i2c-i801: Rename local variable temp to status i2c-i801: Properly report bus arbitration loss i2c-i801: Remove verbose debugging messages i2c-algo-pcf: Drop unused struct members i2c-algo-pcf: Multi-master lost-arbitration improvement i2c: Deprecate the legacy gpio drivers i2c-pxa: Initialize early ...
Diffstat (limited to 'drivers/i2c/chips/pca9539.c')
-rw-r--r--drivers/i2c/chips/pca9539.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/i2c/chips/pca9539.c b/drivers/i2c/chips/pca9539.c
index f43c4e7..58ab7f2 100644
--- a/drivers/i2c/chips/pca9539.c
+++ b/drivers/i2c/chips/pca9539.c
@@ -113,7 +113,7 @@ static int pca9539_attach_adapter(struct i2c_adapter *adapter)
/* This function is called by i2c_probe */
static int pca9539_detect(struct i2c_adapter *adapter, int address, int kind)
{
- struct i2c_client *new_client;
+ struct i2c_client *client;
struct pca9539_data *data;
int err = 0;
@@ -127,29 +127,28 @@ static int pca9539_detect(struct i2c_adapter *adapter, int address, int kind)
goto exit;
}
- new_client = &data->client;
- i2c_set_clientdata(new_client, data);
- new_client->addr = address;
- new_client->adapter = adapter;
- new_client->driver = &pca9539_driver;
- new_client->flags = 0;
+ client = &data->client;
+ i2c_set_clientdata(client, data);
+ client->addr = address;
+ client->adapter = adapter;
+ client->driver = &pca9539_driver;
if (kind < 0) {
/* Detection: the pca9539 only has 8 registers (0-7).
A read of 7 should succeed, but a read of 8 should fail. */
- if ((i2c_smbus_read_byte_data(new_client, 7) < 0) ||
- (i2c_smbus_read_byte_data(new_client, 8) >= 0))
+ if ((i2c_smbus_read_byte_data(client, 7) < 0) ||
+ (i2c_smbus_read_byte_data(client, 8) >= 0))
goto exit_kfree;
}
- strlcpy(new_client->name, "pca9539", I2C_NAME_SIZE);
+ strlcpy(client->name, "pca9539", I2C_NAME_SIZE);
/* Tell the I2C layer a new client has arrived */
- if ((err = i2c_attach_client(new_client)))
+ if ((err = i2c_attach_client(client)))
goto exit_kfree;
/* Register sysfs hooks */
- err = sysfs_create_group(&new_client->dev.kobj,
+ err = sysfs_create_group(&client->dev.kobj,
&pca9539_defattr_group);
if (err)
goto exit_detach;
@@ -157,7 +156,7 @@ static int pca9539_detect(struct i2c_adapter *adapter, int address, int kind)
return 0;
exit_detach:
- i2c_detach_client(new_client);
+ i2c_detach_client(client);
exit_kfree:
kfree(data);
exit: