lkml.org 
[lkml]   [2021]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 00/60] drm: Make all drivers to honour the nomodeset parameter
From
On 12/15/21 10:10, Thomas Zimmermann wrote:

[snip]

>
> An extra pointer sounds indeed like over-engineering. If we take ast for
> example, I'd just do something like this:
>
> static ast_pci_register_driver(struct pci_driver *pci)
> {
> if (drm_firmware_drivers_only() && ast_modeset == -1)
> return -ENODEV;
> if (ast_modeset == 0)
> return -ENODEV;
>
> return pci_register_driver(pci);
> }
>
> module_driver(&ast_pci_driver, ast_pci_register_driver,
> pci_unregister_driver)
>
> That removes some of the boiler-plate module code without changing the
> driver's behavior.
>

Agreed that would be a nice cleanup and could allow to for example get rid
of the following module exit function that's just a wrapper:

static void __exit ast_exit(void)
{
pci_unregister_driver(&ast_pci_driver);
}

But I think these cleanups are out of scope for this series and could be
done as a follow-up. Since the drm_firmware_drivers_only() check would
be needed in the module init function anyways.

> Best regards
> Thomas
>
Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat

\
 
 \ /
  Last update: 2021-12-16 00:27    [W:0.066 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site