lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sun, 1 May 2022 19:00:15 +0100
From:   Jonathan Cameron <jic23@...nel.org>
To:     Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc:     Lars-Peter Clausen <lars@...afoo.de>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>,
        linux-iio@...r.kernel.org,
        linux-stm32@...md-mailman.stormreply.com,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] iio: stmpe-adc: use of_device_id for OF matching

On Sun,  1 May 2022 12:34:46 +0200
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org> wrote:

> The of_device_id was added to allow module autoloading, but it should be
> also used to allow driver matching via Devicetree.
> 
> This also fixes W=1 warning:
>   drivers/iio/adc/stmpe-adc.c:357:34: error: ‘stmpe_adc_ids’ defined but not used [-Werror=unused-const-variable=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Series applied to the togreg branch of iio.git and pushed out as testing for 0-day
to poke at it.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/stmpe-adc.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c
> index d2d405388499..0208789fc0f5 100644
> --- a/drivers/iio/adc/stmpe-adc.c
> +++ b/drivers/iio/adc/stmpe-adc.c
> @@ -345,21 +345,22 @@ static int __maybe_unused stmpe_adc_resume(struct device *dev)
>  
>  static SIMPLE_DEV_PM_OPS(stmpe_adc_pm_ops, NULL, stmpe_adc_resume);
>  
> +static const struct of_device_id stmpe_adc_ids[] = {
> +	{ .compatible = "st,stmpe-adc", },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, stmpe_adc_ids);
> +
>  static struct platform_driver stmpe_adc_driver = {
>  	.probe		= stmpe_adc_probe,
>  	.driver		= {
>  		.name	= "stmpe-adc",
>  		.pm	= &stmpe_adc_pm_ops,
> +		.of_match_table = stmpe_adc_ids,
>  	},
>  };
>  module_platform_driver(stmpe_adc_driver);
>  
> -static const struct of_device_id stmpe_adc_ids[] = {
> -	{ .compatible = "st,stmpe-adc", },
> -	{ },
> -};
> -MODULE_DEVICE_TABLE(of, stmpe_adc_ids);
> -
>  MODULE_AUTHOR("Stefan Agner <stefan.agner@...adex.com>");
>  MODULE_DESCRIPTION("STMPEXXX ADC driver");
>  MODULE_LICENSE("GPL v2");

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ