[Intel-gfx] [PATCH v2 2/3] pwm/core: Try to get the module from pwm_get
Thierry Reding
thierry.reding at gmail.com
Mon Jan 30 08:17:13 UTC 2017
On Sun, Jan 22, 2017 at 05:14:08PM +0100, Hans de Goede wrote:
> Add a module_name string to the pwm_lookup struct and if specified
> and pwmchip_find_by_name() does not find the pwmchip try calling
> request_module with the specified name.
>
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
> drivers/pwm/core.c | 4 ++++
> include/linux/pwm.h | 11 +++++++++--
> 2 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
> index 0d3ef29..c418a7a 100644
> --- a/drivers/pwm/core.c
> +++ b/drivers/pwm/core.c
> @@ -823,6 +823,10 @@ struct pwm_device *pwm_get(struct device *dev, const char *con_id)
> return ERR_PTR(-ENODEV);
>
> chip = pwmchip_find_by_name(chosen->provider);
> + if (!chip && chosen->module_name) {
> + request_module(chosen->module_name);
How about checking for an error code here? It's kind of pointless to try
again if the module didn't load in the first place. No need to respin, I
can make that change as I apply.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20170130/0db6397a/attachment.sig>
More information about the Intel-gfx
mailing list