Skip to content

Commit 8637b3d

Browse files
billy-tsaiSasha Levin
authored andcommitted
gpio: aspeed-sgpio: Change the macro to support deferred probe
[ Upstream commit e18533b023ec7a33488bcf33140ce69bbba2894f ] Use module_platform_driver() to replace module_platform_driver_probe(). The former utilizes platform_driver_register(), which allows the driver to defer probing when it doesn't acquire the necessary resources due to probe order. In contrast, the latter uses __platform_driver_probe(), which includes the comment "Note that this is incompatible with deferred probing." Since our SGPIO driver requires access to the clock resource, the former is more suitable. Reviewed-by: Linus Walleij <linusw@kernel.org> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com> Link: https://lore.kernel.org/r/20260123-upstream_sgpio-v2-1-69cfd1631400@aspeedtech.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d2c93fa commit 8637b3d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/gpio/gpio-aspeed-sgpio.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ static const struct of_device_id aspeed_sgpio_of_table[] = {
508508

509509
MODULE_DEVICE_TABLE(of, aspeed_sgpio_of_table);
510510

511-
static int __init aspeed_sgpio_probe(struct platform_device *pdev)
511+
static int aspeed_sgpio_probe(struct platform_device *pdev)
512512
{
513513
u32 nr_gpios, sgpio_freq, sgpio_clk_div, gpio_cnt_regval, pin_mask;
514514
const struct aspeed_sgpio_pdata *pdata;
@@ -601,12 +601,13 @@ static int __init aspeed_sgpio_probe(struct platform_device *pdev)
601601
}
602602

603603
static struct platform_driver aspeed_sgpio_driver = {
604+
.probe = aspeed_sgpio_probe,
604605
.driver = {
605606
.name = KBUILD_MODNAME,
606607
.of_match_table = aspeed_sgpio_of_table,
607608
},
608609
};
609610

610-
module_platform_driver_probe(aspeed_sgpio_driver, aspeed_sgpio_probe);
611+
module_platform_driver(aspeed_sgpio_driver);
611612
MODULE_DESCRIPTION("Aspeed Serial GPIO Driver");
612613
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)