diff mbox series

[-next,2/3] drm/tegra: Enable module autoloading

Message ID 20240902113320.903147-3-liaochen4@huawei.com
State Rejected
Headers show
Series drm: Enable module autoloading | expand

Commit Message

liaochen (A) Sept. 2, 2024, 11:33 a.m. UTC
Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based
on the alias from of_device_id table.

Signed-off-by: Liao Chen <liaochen4@huawei.com>
---
 drivers/gpu/drm/tegra/drm.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Dmitry Baryshkov Sept. 23, 2024, 4:21 a.m. UTC | #1
On Mon, Sep 02, 2024 at 11:33:19AM GMT, Liao Chen wrote:
> Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based
> on the alias from of_device_id table.
> 
> Signed-off-by: Liao Chen <liaochen4@huawei.com>
> ---
>  drivers/gpu/drm/tegra/drm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
> index 03d1c76aec2d..1a12f2eaad86 100644
> --- a/drivers/gpu/drm/tegra/drm.c
> +++ b/drivers/gpu/drm/tegra/drm.c
> @@ -1390,6 +1390,7 @@ static const struct of_device_id host1x_drm_subdevs[] = {
>  	{ .compatible = "nvidia,tegra234-nvdec", },
>  	{ /* sentinel */ }
>  };
> +MODULE_DEVICE_TABLE(of, host1x_drm_subdevs);

I don't think it is correct. See how subdevs are handled in
host1x_device_parse_dt(). I'll pick up two other patches though.

>  
>  static struct host1x_driver host1x_drm_driver = {
>  	.driver = {
> -- 
> 2.34.1
>
Thierry Reding Sept. 25, 2024, 1:45 p.m. UTC | #2
On Mon, Sep 23, 2024 at 07:21:21AM GMT, Dmitry Baryshkov wrote:
> On Mon, Sep 02, 2024 at 11:33:19AM GMT, Liao Chen wrote:
> > Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based
> > on the alias from of_device_id table.
> > 
> > Signed-off-by: Liao Chen <liaochen4@huawei.com>
> > ---
> >  drivers/gpu/drm/tegra/drm.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
> > index 03d1c76aec2d..1a12f2eaad86 100644
> > --- a/drivers/gpu/drm/tegra/drm.c
> > +++ b/drivers/gpu/drm/tegra/drm.c
> > @@ -1390,6 +1390,7 @@ static const struct of_device_id host1x_drm_subdevs[] = {
> >  	{ .compatible = "nvidia,tegra234-nvdec", },
> >  	{ /* sentinel */ }
> >  };
> > +MODULE_DEVICE_TABLE(of, host1x_drm_subdevs);
> 
> I don't think it is correct. See how subdevs are handled in
> host1x_device_parse_dt(). I'll pick up two other patches though.

Agreed. This shouldn't be needed since all of these compatible strings
should show up in the OF device ID table of their corresponding drivers,
which is where the export should happen.

Thierry
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 03d1c76aec2d..1a12f2eaad86 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -1390,6 +1390,7 @@  static const struct of_device_id host1x_drm_subdevs[] = {
 	{ .compatible = "nvidia,tegra234-nvdec", },
 	{ /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, host1x_drm_subdevs);
 
 static struct host1x_driver host1x_drm_driver = {
 	.driver = {