Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: accel: mxc4005: allow module autoloading via OF compatible

Add OF device table with compatible strings to allow automatic module
loading.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231004-mxc4005-device-tree-support-v1-2-e7c0faea72e4@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Luca Ceresoli and committed by
Jonathan Cameron
4d7c16d0 2d3dff57

+8
+8
drivers/iio/accel/mxc4005.c
··· 476 476 }; 477 477 MODULE_DEVICE_TABLE(acpi, mxc4005_acpi_match); 478 478 479 + static const struct of_device_id mxc4005_of_match[] = { 480 + { .compatible = "memsic,mxc4005", }, 481 + { .compatible = "memsic,mxc6655", }, 482 + { }, 483 + }; 484 + MODULE_DEVICE_TABLE(of, mxc4005_of_match); 485 + 479 486 static const struct i2c_device_id mxc4005_id[] = { 480 487 {"mxc4005", 0}, 481 488 {"mxc6655", 0}, ··· 494 487 .driver = { 495 488 .name = MXC4005_DRV_NAME, 496 489 .acpi_match_table = ACPI_PTR(mxc4005_acpi_match), 490 + .of_match_table = mxc4005_of_match, 497 491 }, 498 492 .probe = mxc4005_probe, 499 493 .id_table = mxc4005_id,