mfd: sta2x11-mfd: Only add sta2x11_mfd if it hasn't already been added
authorDavide Ciminaghi <ciminaghi@gnudd.com>
Fri, 9 Nov 2012 14:19:56 +0000 (15:19 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 20 Nov 2012 11:21:15 +0000 (12:21 +0100)
The pci probe method is called twice now, so we have to call
sta2x11_mfd_add() only once to avoid a -EBUSY error.

Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/sta2x11-mfd.c

index 8d38ef264722b93e2f7cd55c104c56d23d17316a..b981dc4a7b3cdf793668b2e02f5f697249650353 100644 (file)
@@ -585,7 +585,8 @@ static int __devinit sta2x11_mfd_probe(struct pci_dev *pdev,
        sta2x11_mfd_setup(pdev, setup_data);
 
        /* Record this pdev before mfd_add_devices: their probe looks for it */
-       sta2x11_mfd_add(pdev, GFP_ATOMIC);
+       if (!sta2x11_mfd_find(pdev))
+               sta2x11_mfd_add(pdev, GFP_ATOMIC);
 
        /* Just 2 bars for all mfd's at present */
        for (i = 0; i < 2; i++) {
This page took 0.025691 seconds and 5 git commands to generate.