[PATCH] gpio: sifive: Support module autoloading

Bartosz Golaszewski brgl at bgdev.pl
Thu Oct 16 02:59:00 PDT 2025


On Thu, Oct 16, 2025 at 2:36 AM Samuel Holland
<samuel.holland at sifive.com> wrote:
>
> Add MODULE_DEVICE_TABLE() so the driver module can be loaded
> automatically based on a compatible string alias.
>
> Signed-off-by: Samuel Holland <samuel.holland at sifive.com>
> ---
>
>  drivers/gpio/gpio-sifive.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpio/gpio-sifive.c b/drivers/gpio/gpio-sifive.c
> index 94ef2efbd14f..e9a992cd4b9c 100644
> --- a/drivers/gpio/gpio-sifive.c
> +++ b/drivers/gpio/gpio-sifive.c
> @@ -260,6 +260,7 @@ static const struct of_device_id sifive_gpio_match[] = {
>         { .compatible = "sifive,fu540-c000-gpio" },
>         { },
>  };
> +MODULE_DEVICE_TABLE(of, sifive_gpio_match);
>
>  static struct platform_driver sifive_gpio_driver = {
>         .probe          = sifive_gpio_probe,
> --
> 2.47.2

It looks like it should have been part of commit 6b4c76ded358 ("gpio:
sifive: Allow building the driver as a module") in the first place. If
that's the case, would you mind resending with a Fixes: and Cc: stable
tags?

Bart



More information about the linux-riscv mailing list