linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] powerpc/pasemi: Remove hardcoded bus numbers on smbus
@ 2017-01-20 17:46 Darren Stevens
  2017-01-24 10:35 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Darren Stevens @ 2017-01-20 17:46 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Christian Zigotzky, R.T.Dickinson, Pat Wall

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>

---

  v2 - remove unnecessary smbus->adapter.nr initialisation.

diff --git a/drivers/i2c/busses/i2c-pasemi.c b/drivers/i2c/busses/i2c-pasemi.c
index df1dbc9..05847fd 100644
--- a/drivers/i2c/busses/i2c-pasemi.c
+++ b/drivers/i2c/busses/i2c-pasemi.c
@@ -365,7 +365,6 @@ 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;
@@ -373,7 +372,7 @@ static int pasemi_smb_probe(struct pci_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;
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-24 10:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-20 17:46 [PATCH v2] powerpc/pasemi: Remove hardcoded bus numbers on smbus Darren Stevens
2017-01-24 10:35 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).