[PATCH v2] powerpc/pasemi: Remove hardcoded bus numbers on smbus

Subsystems: i2c subsystem, i2c subsystem host drivers, linux for powerpc (32-bit and 64-bit), the rest

STALE3551d

2 messages, 2 authors, 2017-01-24 · open the first message on its own page

[PATCH v2] powerpc/pasemi: Remove hardcoded bus numbers on smbus

From: Darren Stevens <hidden>
Date: 2017-01-20 18:09:36

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 <redacted>

---

  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;
 

Re: [PATCH v2] powerpc/pasemi: Remove hardcoded bus numbers on smbus

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-01-24 10:36:00

Darren Stevens [off-list ref] writes:
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.
This is an i2c patch so the subject should be something like:

i2c/pasemi: Remove hardcoded bus numbers on smbus

And it should be sent to:

wsa@the-dreams.de
linux-i2c@vger.kernel.org
linuxppc-dev@lists.ozlabs.org
linux-kernel@vger.kernel.org

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help