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

reset: imx7: Support module build

Use module_platform_driver(), add module device table, author,
description and license to support module build, and
CONFIG_RESET_IMX7 is changed to default 'y' ONLY for i.MX7D,
other platforms need to select it in defconfig.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

authored by

Anson Huang and committed by
Philipp Zabel
a442abbb 9123e3a7

+10 -4
+3 -2
drivers/reset/Kconfig
··· 65 65 This enables the reset controller driver for HSDK board. 66 66 67 67 config RESET_IMX7 68 - bool "i.MX7/8 Reset Driver" if COMPILE_TEST 68 + tristate "i.MX7/8 Reset Driver" 69 69 depends on HAS_IOMEM 70 - default SOC_IMX7D || (ARM64 && ARCH_MXC) 70 + depends on SOC_IMX7D || (ARM64 && ARCH_MXC) || COMPILE_TEST 71 + default y if SOC_IMX7D 71 72 select MFD_SYSCON 72 73 help 73 74 This enables the reset controller driver for i.MX7 SoCs.
+7 -2
drivers/reset/reset-imx7.c
··· 8 8 */ 9 9 10 10 #include <linux/mfd/syscon.h> 11 - #include <linux/mod_devicetable.h> 11 + #include <linux/module.h> 12 12 #include <linux/of_device.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/reset-controller.h> ··· 386 386 { .compatible = "fsl,imx8mp-src", .data = &variant_imx8mp }, 387 387 { /* sentinel */ }, 388 388 }; 389 + MODULE_DEVICE_TABLE(of, imx7_reset_dt_ids); 389 390 390 391 static struct platform_driver imx7_reset_driver = { 391 392 .probe = imx7_reset_probe, ··· 395 394 .of_match_table = imx7_reset_dt_ids, 396 395 }, 397 396 }; 398 - builtin_platform_driver(imx7_reset_driver); 397 + module_platform_driver(imx7_reset_driver); 398 + 399 + MODULE_AUTHOR("Andrey Smirnov <andrew.smirnov@gmail.com>"); 400 + MODULE_DESCRIPTION("NXP i.MX7 reset driver"); 401 + MODULE_LICENSE("GPL v2");