From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751387AbdBZV4n (ORCPT ); Sun, 26 Feb 2017 16:56:43 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:54737 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751284AbdBZV4l (ORCPT ); Sun, 26 Feb 2017 16:56:41 -0500 From: Darren Stevens To: wsa@the-dreams.de, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org CC: linuxppc-dev@lists.ozlabs.org Date: Sun, 26 Feb 2017 21:49:47 +0000 (GMT) Message-ID: <49a70e4c93e.69f983e3@auth.smtp.1and1.co.uk> User-Agent: YAM/2.9p1 (AmigaOS4; PPC; rv:20140418r7798) Subject: [RESEND PATCH] i2c/busses/pasemi: Remove hardcoded bus numbers on smbus MIME-Version: 1.0 Content-type: multipart/mixed; boundary="--=_BOUNDARY.6f0aa3906112474f.a6" X-Provags-ID: V03:K0:O8BDnMhVwRdE3AsV9hd0N7xPBj3ENbGqqClvLWkp6caYeizQzTM 5UIcRpsb83q4+qNBKpMVybiqynB+SYx+G5GnuCMYKwWyV0UEEo5R+6oZDty2/uqd4DG8NLw K9IP9TtWxnPE3UQZ8r6+TwvT4MKu/ioolpR1ccEIsxty0cVgbZdK5329T37UlDAE1Au/832 RosqxMc0VenyEgE8t1c4w== X-UI-Out-Filterresults: notjunk:1;V01:K0:8KpmWiD7ppk=:pwVphKXUQefSNRPlcUURqK pLP0VEhSy34vyHj3sXOevNUmWDtFu7AofaskEU+6/Fguw8qkEvQi65Wf1zcdeyLk7KXTcnwhM ROwsHnCO0PPMC0zzJveawEr4roIxBWecaXmMW5KC2dClSxGcZmF96wDl2zrihwlvbq8tRG3Qe 2tG9MRBZSetQ7cyVz2b284NaeGrImpMjREzMAjzWTX7N2u0uEPqbozv6MlKOpjdnyiIXR5Bn6 +sdeKQaIpsYrZrpP492IEUlwQi8XyVCS+VdExmFjAFueBX8B7fEV3rhX7u7CplcJjXp9AxIXc icUPjeBKmrlOq+pq0N96YvQodB1Q/fa179s2CuQyIMlLfPsn/LChiwE9qbxkQUXbw7ZCI0q4C WLphusvmGsvrulLiAsQ0zGh+qBRT9xZq5ee7I/ZMGGwLS60q9eH6oMFSbY7mabn9gIyxnj3ju sB0pruNK8OjN61+SzLlEUFuxt3NqBP2hFhl2GXSQAvZp7TdbWqVJI8RplYTl9NaKyLm6MVOUG Uys5XuRepoJlExCBBi5sxNlIRxRdZNPDPwi8Sjd80S7p9ERqClMuVKLrX5xQs40lIMnTi5UDc fz6UI605oHikef8ShLwAGoTmGtwR3dYZMUEIY6rgq/VyOuBorEMaZxbKH3dC2Pz0pH877ICzK nbtfU/FzpcIaAH7vViJUZ6xUFaFS3EC3OLEpLARJkmlj6hD6TgdBi09w6iv0XTd724VA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Warning: This is a message in MIME format. Your mail reader does not support MIME. Some parts of this message will be readable as plain text. To see the rest, you will need to upgrade your mail reader. Following are some URLs where you can find MIME-capable mail programs for common platforms: AmigaOS...........: http://yam.ch/ Unix/MacOS/Windows: http://www.mozilla.com/thunderbird/ General information about MIME can be found at: http://en.wikipedia.org/wiki/MIME ----=_BOUNDARY.6f0aa3906112474f.a6 Content-Type: text/plain 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 --- Resent as it doesn't seem to have reached linux-i2c mailing list. ----=_BOUNDARY.6f0aa3906112474f.a6 Content-Type: text/plain; name="i2c.patch" Content-Disposition: attachment; filename="i2c.patch"; size=826 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; ----=_BOUNDARY.6f0aa3906112474f.a6--