Skip to content

Commit

Permalink
mfd: sta2x11-mfd: Only add sta2x11_mfd if it hasn't already been added
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Davide Ciminaghi authored and Samuel Ortiz committed Nov 20, 2012
1 parent b18adaf commit 8ec86a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mfd/sta2x11-mfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 8ec86a3

Please sign in to comment.