From: Davide Ciminaghi Date: Fri, 9 Nov 2012 14:19:56 +0000 (+0100) Subject: mfd: sta2x11-mfd: Only add sta2x11_mfd if it hasn't already been added X-Git-Tag: v3.8-rc1~85^2~65 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ec86a302a190bc4864928dd69f3f22066137b68;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git mfd: sta2x11-mfd: Only add sta2x11_mfd if it hasn't already been added 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 Acked-by: Alessandro Rubini Signed-off-by: Samuel Ortiz --- diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c index 8d38ef2..b981dc4 100644 --- a/drivers/mfd/sta2x11-mfd.c +++ b/drivers/mfd/sta2x11-mfd.c @@ -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++) {