Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172360
b: refs/heads/master
c: bc6286e
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare committed Dec 6, 2009
1 parent 540f49e commit 3d067f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 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: 6dfa5ca3c9a35cb395ab1f51e0e500106c85dff4
refs/heads/master: bc6286e50b4a34d8af52132d6e22f85c6c8853a7
11 changes: 5 additions & 6 deletions trunk/drivers/i2c/busses/i2c-powermac.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ static int __devinit i2c_powermac_probe(struct platform_device *dev)
struct pmac_i2c_bus *bus = dev->dev.platform_data;
struct device_node *parent = NULL;
struct i2c_adapter *adapter;
char name[32];
const char *basename;
int rc;

if (bus == NULL)
return -EINVAL;
adapter = pmac_i2c_get_adapter(bus);

/* Ok, now we need to make up a name for the interface that will
* match what we used to do in the past, that is basically the
Expand All @@ -255,23 +255,22 @@ static int __devinit i2c_powermac_probe(struct platform_device *dev)
default:
return -EINVAL;
}
snprintf(name, 32, "%s %d", basename, pmac_i2c_get_channel(bus));
snprintf(adapter->name, sizeof(adapter->name), "%s %d", basename,
pmac_i2c_get_channel(bus));
of_node_put(parent);

adapter = pmac_i2c_get_adapter(bus);
platform_set_drvdata(dev, adapter);
strcpy(adapter->name, name);
adapter->algo = &i2c_powermac_algorithm;
i2c_set_adapdata(adapter, bus);
adapter->dev.parent = &dev->dev;
rc = i2c_add_adapter(adapter);
if (rc) {
printk(KERN_ERR "i2c-powermac: Adapter %s registration "
"failed\n", name);
"failed\n", adapter->name);
memset(adapter, 0, sizeof(*adapter));
}

printk(KERN_INFO "PowerMac i2c bus %s registered\n", name);
printk(KERN_INFO "PowerMac i2c bus %s registered\n", adapter->name);

if (!strncmp(basename, "uni-n", 5)) {
struct device_node *np;
Expand Down

0 comments on commit 3d067f3

Please sign in to comment.