aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-core.c
diff options
context:
space:
mode:
authorZhenwen Xu <helight.xu@gmail.com>2009-03-28 16:34:46 -0400
committerJean Delvare <khali@linux-fr.org>2009-03-28 16:34:46 -0400
commit09b8ce0a691d8e76f14a16ac6cbfde899f6c68e3 (patch)
tree699fa8439bcb0541633649717e19c51aaf5e9c4e /drivers/i2c/i2c-core.c
parent506a8b6c27cb08998dc13069fbdf6eb7ec748b99 (diff)
i2c-core: Some style cleanups
Some lines over 80. The printk(KERN_ERR ... ) should be dev_err. And some blankspace should be deleted. Signed-off-by: Zhenwen Xu <helight.xu@gmail.com> Signed-off-by: Jean Delvare <khlai@linux-fr.org>
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r--drivers/i2c/i2c-core.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index e361033815d3..b6f3a0de6ca2 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -152,7 +152,7 @@ static void i2c_device_shutdown(struct device *dev)
152 driver->shutdown(to_i2c_client(dev)); 152 driver->shutdown(to_i2c_client(dev));
153} 153}
154 154
155static int i2c_device_suspend(struct device * dev, pm_message_t mesg) 155static int i2c_device_suspend(struct device *dev, pm_message_t mesg)
156{ 156{
157 struct i2c_driver *driver; 157 struct i2c_driver *driver;
158 158
@@ -164,7 +164,7 @@ static int i2c_device_suspend(struct device * dev, pm_message_t mesg)
164 return driver->suspend(to_i2c_client(dev), mesg); 164 return driver->suspend(to_i2c_client(dev), mesg);
165} 165}
166 166
167static int i2c_device_resume(struct device * dev) 167static int i2c_device_resume(struct device *dev)
168{ 168{
169 struct i2c_driver *driver; 169 struct i2c_driver *driver;
170 170
@@ -187,13 +187,15 @@ static void i2c_client_dev_release(struct device *dev)
187 kfree(to_i2c_client(dev)); 187 kfree(to_i2c_client(dev));
188} 188}
189 189
190static ssize_t show_client_name(struct device *dev, struct device_attribute *attr, char *buf) 190static ssize_t
191show_client_name(struct device *dev, struct device_attribute *attr, char *buf)
191{ 192{
192 struct i2c_client *client = to_i2c_client(dev); 193 struct i2c_client *client = to_i2c_client(dev);
193 return sprintf(buf, "%s\n", client->name); 194 return sprintf(buf, "%s\n", client->name);
194} 195}
195 196
196static ssize_t show_modalias(struct device *dev, struct device_attribute *attr, char *buf) 197static ssize_t
198show_modalias(struct device *dev, struct device_attribute *attr, char *buf)
197{ 199{
198 struct i2c_client *client = to_i2c_client(dev); 200 struct i2c_client *client = to_i2c_client(dev);
199 return sprintf(buf, "%s%s\n", I2C_MODULE_PREFIX, client->name); 201 return sprintf(buf, "%s%s\n", I2C_MODULE_PREFIX, client->name);
@@ -365,8 +367,7 @@ static struct i2c_driver dummy_driver = {
365 * This returns the new i2c client, which should be saved for later use with 367 * This returns the new i2c client, which should be saved for later use with
366 * i2c_unregister_device(); or NULL to indicate an error. 368 * i2c_unregister_device(); or NULL to indicate an error.
367 */ 369 */
368struct i2c_client * 370struct i2c_client *i2c_new_dummy(struct i2c_adapter *adapter, u16 address)
369i2c_new_dummy(struct i2c_adapter *adapter, u16 address)
370{ 371{
371 struct i2c_board_info info = { 372 struct i2c_board_info info = {
372 I2C_BOARD_INFO("dummy", address), 373 I2C_BOARD_INFO("dummy", address),
@@ -413,8 +414,8 @@ static void i2c_scan_static_board_info(struct i2c_adapter *adapter)
413 if (devinfo->busnum == adapter->nr 414 if (devinfo->busnum == adapter->nr
414 && !i2c_new_device(adapter, 415 && !i2c_new_device(adapter,
415 &devinfo->board_info)) 416 &devinfo->board_info))
416 printk(KERN_ERR "i2c-core: can't create i2c%d-%04x\n", 417 dev_err(&adapter->dev,
417 i2c_adapter_id(adapter), 418 "Can't create device at 0x%02x\n",
418 devinfo->board_info.addr); 419 devinfo->board_info.addr);
419 } 420 }
420 mutex_unlock(&__i2c_board_lock); 421 mutex_unlock(&__i2c_board_lock);
@@ -1020,7 +1021,7 @@ module_exit(i2c_exit);
1020 * Note that there is no requirement that each message be sent to 1021 * Note that there is no requirement that each message be sent to
1021 * the same slave address, although that is the most common model. 1022 * the same slave address, although that is the most common model.
1022 */ 1023 */
1023int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg *msgs, int num) 1024int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
1024{ 1025{
1025 int ret; 1026 int ret;
1026 1027
@@ -1527,8 +1528,7 @@ EXPORT_SYMBOL(i2c_put_adapter);
1527/* The SMBus parts */ 1528/* The SMBus parts */
1528 1529
1529#define POLY (0x1070U << 3) 1530#define POLY (0x1070U << 3)
1530static u8 1531static u8 crc8(u16 data)
1531crc8(u16 data)
1532{ 1532{
1533 int i; 1533 int i;
1534 1534
@@ -1992,9 +1992,9 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter * adapter, u16 addr,
1992 * This executes an SMBus protocol operation, and returns a negative 1992 * This executes an SMBus protocol operation, and returns a negative
1993 * errno code else zero on success. 1993 * errno code else zero on success.
1994 */ 1994 */
1995s32 i2c_smbus_xfer(struct i2c_adapter * adapter, u16 addr, unsigned short flags, 1995s32 i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, unsigned short flags,
1996 char read_write, u8 command, int protocol, 1996 char read_write, u8 command, int protocol,
1997 union i2c_smbus_data * data) 1997 union i2c_smbus_data *data)
1998{ 1998{
1999 s32 res; 1999 s32 res;
2000 2000