Skip to content

Commit

Permalink
i2c-pasemi: use i2c_add_numbered_adapter()
Browse files Browse the repository at this point in the history
Use numbered adapter registration to always have the same hardware bus
show up at the same number.

PWRficient 1682M has three buses, they are all on the same PCI device but
different functions. So do the simple thing and register them based on
function number. Future products, if having a different number of busses,
are expected to have similar behaviour w.r.t. device/function layout.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Olof Johansson authored and Jean Delvare committed Jan 27, 2008
1 parent 541b6a7 commit ccf60d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/i2c/busses/i2c-pasemi.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,15 @@ static int __devinit pasemi_smb_probe(struct pci_dev *dev,
smbus->adapter.class = I2C_CLASS_HWMON;
smbus->adapter.algo = &smbus_algorithm;
smbus->adapter.algo_data = smbus;
smbus->adapter.nr = PCI_FUNC(dev->devfn);

/* set up the sysfs linkage to our parent device */
smbus->adapter.dev.parent = &dev->dev;

reg_write(smbus, REG_CTL, (CTL_MTR | CTL_MRR |
(CLK_100K_DIV & CTL_CLK_M)));

error = i2c_add_adapter(&smbus->adapter);
error = i2c_add_numbered_adapter(&smbus->adapter);
if (error)
goto out_release_region;

Expand Down

0 comments on commit ccf60d8

Please sign in to comment.