Skip to content

Commit

Permalink
i2c: pasemi: remove hardcoded bus numbers on smbus
Browse files Browse the repository at this point in the history
The pasemi smbus controller uses PCI_FUNC(dev->devfn) to define which
number bus to attach to, however this fails when something else is
probed first, for example an ATI Radeon graphics card will claim 9 or
10 busses, including the ones the pasemi wants.
Patch the driver to call i2c_add_adapter rather than
i2c_add_numbered_adapter.

Signed-off-by: Darren Stevens <darren@stevens-zone.net>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Darren Stevens authored and Wolfram Sang committed Aug 20, 2018
1 parent 15c566f commit 5c18d12
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/i2c/busses/i2c-pasemi.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,14 @@ static int pasemi_smb_probe(struct pci_dev *dev,
smbus->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
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_numbered_adapter(&smbus->adapter);
error = i2c_add_adapter(&smbus->adapter);
if (error)
goto out_release_region;

Expand Down

0 comments on commit 5c18d12

Please sign in to comment.