Commit 046dab28 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Jonathan Cameron

iio: stmpe-adc: use of_device_id for OF matching

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: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220501103447.111392-1-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent e678aced
...@@ -345,21 +345,22 @@ static int __maybe_unused stmpe_adc_resume(struct device *dev) ...@@ -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 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 = { static struct platform_driver stmpe_adc_driver = {
.probe = stmpe_adc_probe, .probe = stmpe_adc_probe,
.driver = { .driver = {
.name = "stmpe-adc", .name = "stmpe-adc",
.pm = &stmpe_adc_pm_ops, .pm = &stmpe_adc_pm_ops,
.of_match_table = stmpe_adc_ids,
}, },
}; };
module_platform_driver(stmpe_adc_driver); 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@toradex.com>"); MODULE_AUTHOR("Stefan Agner <stefan.agner@toradex.com>");
MODULE_DESCRIPTION("STMPEXXX ADC driver"); MODULE_DESCRIPTION("STMPEXXX ADC driver");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment