Skip to content

Commit

Permalink
pcmcia: at91_cf: fix deferred probe from __init
Browse files Browse the repository at this point in the history
Move probe out of __init section and don't use platform_driver_probe
which cannot be used with deferred probing.

Since commit e935457 ("gpiolib: Defer failed gpio requests by default")
this driver might return -EPROBE_DEFER if a gpio_request fails.

Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
jhovold authored and gregkh committed Sep 26, 2013
1 parent 2c2b928 commit 16a7c7c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions drivers/pcmcia/at91_cf.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ static int at91_cf_dt_init(struct platform_device *pdev)
}
#endif

static int __init at91_cf_probe(struct platform_device *pdev)
static int at91_cf_probe(struct platform_device *pdev)
{
struct at91_cf_socket *cf;
struct at91_cf_data *board = pdev->dev.platform_data;
Expand Down Expand Up @@ -354,7 +354,7 @@ static int __init at91_cf_probe(struct platform_device *pdev)
return status;
}

static int __exit at91_cf_remove(struct platform_device *pdev)
static int at91_cf_remove(struct platform_device *pdev)
{
struct at91_cf_socket *cf = platform_get_drvdata(pdev);

Expand Down Expand Up @@ -404,14 +404,13 @@ static struct platform_driver at91_cf_driver = {
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(at91_cf_dt_ids),
},
.remove = __exit_p(at91_cf_remove),
.probe = at91_cf_probe,
.remove = at91_cf_remove,
.suspend = at91_cf_suspend,
.resume = at91_cf_resume,
};

/*--------------------------------------------------------------------------*/

module_platform_driver_probe(at91_cf_driver, at91_cf_probe);
module_platform_driver(at91_cf_driver);

MODULE_DESCRIPTION("AT91 Compact Flash Driver");
MODULE_AUTHOR("David Brownell");
Expand Down

0 comments on commit 16a7c7c

Please sign in to comment.