Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45307
b: refs/heads/master
c: b119dc3
h: refs/heads/master
i:
  45305: ea189c3
  45303: 55e7a8d
v: v3
  • Loading branch information
David Brownell authored and Jean Delvare committed Jan 4, 2007
1 parent 321fdd4 commit 10738c8
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 999445d4372812f361807b76411c158099e8e93e
refs/heads/master: b119dc3f992183a04e508fc0a09f550eb19bf30e
17 changes: 17 additions & 0 deletions trunk/Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,23 @@ Who: Jean Delvare <khali@linux-fr.org>

---------------------------

What: i2c_adapter.dev
i2c_adapter.list
When: July 2007
Why: Superfluous, given i2c_adapter.class_dev:
* The "dev" was a stand-in for the physical device node that legacy
drivers would not have; but now it's almost always present. Any
remaining legacy drivers must upgrade (they now trigger warnings).
* The "list" duplicates class device children.
The delay in removing this is so upgraded lm_sensors and libsensors
can get deployed. (Removal causes minor changes in the sysfs layout,
notably the location of the adapter type name and parenting the i2c
client hardware directly from their controller.)
Who: Jean Delvare <khali@linux-fr.org>,
David Brownell <dbrownell@users.sourceforge.net>

---------------------------

What: IPv4 only connection tracking/NAT/helpers
When: 2.6.22
Why: The new layer 3 independant connection tracking replaces the old
Expand Down
28 changes: 24 additions & 4 deletions trunk/drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,32 @@ struct device_driver i2c_adapter_driver = {
.bus = &i2c_bus_type,
};

/* ------------------------------------------------------------------------- */

/* I2C bus adapters -- one roots each I2C or SMBUS segment */

static void i2c_adapter_class_dev_release(struct class_device *dev)
{
struct i2c_adapter *adap = class_dev_to_i2c_adapter(dev);
complete(&adap->class_dev_released);
}

static ssize_t i2c_adapter_show_name(struct class_device *cdev, char *buf)
{
struct i2c_adapter *adap = class_dev_to_i2c_adapter(cdev);
return sprintf(buf, "%s\n", adap->name);
}

static struct class_device_attribute i2c_adapter_attrs[] = {
__ATTR(name, S_IRUGO, i2c_adapter_show_name, NULL),
{ },
};

struct class i2c_adapter_class = {
.owner = THIS_MODULE,
.name = "i2c-adapter",
.release = &i2c_adapter_class_dev_release,
.owner = THIS_MODULE,
.name = "i2c-adapter",
.class_dev_attrs = i2c_adapter_attrs,
.release = &i2c_adapter_class_dev_release,
};

static ssize_t show_adapter_name(struct device *dev, struct device_attribute *attr, char *buf)
Expand Down Expand Up @@ -175,8 +191,12 @@ int i2c_add_adapter(struct i2c_adapter *adap)
* If the parent pointer is not set up,
* we add this adapter to the host bus.
*/
if (adap->dev.parent == NULL)
if (adap->dev.parent == NULL) {
adap->dev.parent = &platform_bus;
printk(KERN_WARNING "**WARNING** I2C adapter driver [%s] "
"forgot to specify physical device; fix it!\n",
adap->name);
}
sprintf(adap->dev.bus_id, "i2c-%d", adap->nr);
adap->dev.driver = &i2c_adapter_driver;
adap->dev.release = &i2c_adapter_dev_release;
Expand Down

0 comments on commit 10738c8

Please sign in to comment.