[i2c] [patch 2.6.19-rc6 13/11] RTCs don't use i2c_adapter.dev
David Brownell
david-b at pacbell.net
Tue Dec 5 00:51:39 CET 2006
Update more I2C drivers that live outside drivers/i2c to understand
that using adapter->dev is not The Way. When actually referring to
the adapter hardware, adapter->class_dev.dev is the answer. When
referring to a device connected to it, client->dev.dev is the answer.
Signed-off-by: David Brownell <dbrownell at users.sourceforge.net>
---
Oh, and worth noting: the patches in this series which make these
changes (#3/adapters, #4 for misc drivers/i2c code, #12/hwmon, and
this one) should not depend on patch #1 which removes adapter->dev;
they could reasonably be merged before that one.
Index: at91/drivers/rtc/rtc-rs5c372.c
===================================================================
--- at91.orig/drivers/rtc/rtc-rs5c372.c 2006-12-04 05:01:54.000000000 -0800
+++ at91/drivers/rtc/rtc-rs5c372.c 2006-12-04 15:20:48.000000000 -0800
@@ -203,7 +203,7 @@ static int rs5c372_probe(struct i2c_adap
struct i2c_client *client;
struct rtc_device *rtc;
- dev_dbg(&adapter->dev, "%s\n", __FUNCTION__);
+ dev_dbg(adapter->class_dev.dev, "%s\n", __FUNCTION__);
if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) {
err = -ENODEV;
Index: at91/drivers/rtc/rtc-pcf8563.c
===================================================================
--- at91.orig/drivers/rtc/rtc-pcf8563.c 2006-10-01 18:42:54.000000000 -0700
+++ at91/drivers/rtc/rtc-pcf8563.c 2006-12-04 15:19:10.000000000 -0800
@@ -192,7 +192,7 @@ static int pcf8563_validate_client(struc
xfer = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
if (xfer != ARRAY_SIZE(msgs)) {
- dev_err(&client->adapter->dev,
+ dev_err(&client->dev,
"%s: could not read register 0x%02X\n",
__FUNCTION__, pattern[i].reg);
@@ -203,7 +203,7 @@ static int pcf8563_validate_client(struc
if (value > pattern[i].max ||
value < pattern[i].min) {
- dev_dbg(&client->adapter->dev,
+ dev_dbg(&client->dev,
"%s: pattern=%d, reg=%x, mask=0x%02x, min=%d, "
"max=%d, value=%d, raw=0x%02X\n",
__FUNCTION__, i, pattern[i].reg, pattern[i].mask,
@@ -253,7 +253,7 @@ static int pcf8563_probe(struct i2c_adap
int err = 0;
- dev_dbg(&adapter->dev, "%s\n", __FUNCTION__);
+ dev_dbg(adapter->class_dev.dev, "%s\n", __FUNCTION__);
if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) {
err = -ENODEV;
Index: at91/drivers/rtc/rtc-ds1672.c
===================================================================
--- at91.orig/drivers/rtc/rtc-ds1672.c 2006-11-02 10:58:36.000000000 -0800
+++ at91/drivers/rtc/rtc-ds1672.c 2006-12-04 15:18:16.000000000 -0800
@@ -199,7 +199,7 @@ static int ds1672_probe(struct i2c_adapt
struct i2c_client *client;
struct rtc_device *rtc;
- dev_dbg(&adapter->dev, "%s\n", __FUNCTION__);
+ dev_dbg(adapter->class_dev.dev, "%s\n", __FUNCTION__);
if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) {
err = -ENODEV;
Index: at91/drivers/rtc/rtc-x1205.c
===================================================================
--- at91.orig/drivers/rtc/rtc-x1205.c 2006-10-01 18:42:54.000000000 -0700
+++ at91/drivers/rtc/rtc-x1205.c 2006-12-04 15:17:16.000000000 -0800
@@ -372,7 +372,7 @@ static int x1205_validate_client(struct
};
if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) {
- dev_err(&client->adapter->dev,
+ dev_err(&client->dev,
"%s: could not read register %x\n",
__FUNCTION__, probe_zero_pattern[i]);
@@ -380,7 +380,7 @@ static int x1205_validate_client(struct
}
if ((buf & probe_zero_pattern[i+1]) != 0) {
- dev_err(&client->adapter->dev,
+ dev_err(&client->dev,
"%s: register=%02x, zero pattern=%d, value=%x\n",
__FUNCTION__, probe_zero_pattern[i], i, buf);
@@ -400,7 +400,7 @@ static int x1205_validate_client(struct
};
if ((xfer = i2c_transfer(client->adapter, msgs, 2)) != 2) {
- dev_err(&client->adapter->dev,
+ dev_err(&client->dev,
"%s: could not read register %x\n",
__FUNCTION__, probe_limits_pattern[i].reg);
@@ -411,7 +411,7 @@ static int x1205_validate_client(struct
if (value > probe_limits_pattern[i].max ||
value < probe_limits_pattern[i].min) {
- dev_dbg(&client->adapter->dev,
+ dev_dbg(&client->dev,
"%s: register=%x, lim pattern=%d, value=%d\n",
__FUNCTION__, probe_limits_pattern[i].reg,
i, value);
@@ -506,7 +506,7 @@ static int x1205_probe(struct i2c_adapte
struct i2c_client *client;
struct rtc_device *rtc;
- dev_dbg(&adapter->dev, "%s\n", __FUNCTION__);
+ dev_dbg(adapter->class_dev.dev, "%s\n", __FUNCTION__);
if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) {
err = -ENODEV;
More information about the i2c
mailing list