Browse Source

ipq806x: fix build errors on 6.12 kernel

- Replace "strlcpy()" with "strscpy()".
- Convert platform driver .remove() to .remove_new().

This patch fixes the following compile errors:

drivers/of/fdt.c:1064:17: error: implicit declaration of function 'strlcpy'; did you mean 'strncpy'? [-Wimplicit-function-declaration]
 1064 |                 strlcpy(cmdline, p, min((int)l, COMMAND_LINE_SIZE));
      |                 ^~~~~~~
      |                 strncpy

drivers/devfreq/krait-cache-devfreq.c:171:27: error: initialization of 'void (*)(struct platform_device *)' from incompatible pointer type 'int (*)(struct platform_device *)' [-Wincompatible-pointer-types]
  171 |         .remove         = krait_cache_remove,
      |                           ^~~~~~~~~~~~~~~~~~

drivers/devfreq/ipq806x-fab-devfreq.c:145:27: error: initialization of 'void (*)(struct platform_device *)' from incompatible pointer type 'int (*)(struct platform_device *)' [-Wincompatible-pointer-types]
  145 |         .remove         = ipq806x_fab_remove,
      |                           ^~~~~~~~~~~~~~~~~~

Signed-off-by: Shiji Yang <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/18989
Signed-off-by: Christian Marangi <[email protected]>
Shiji Yang 7 months ago
parent
commit
1125d07cf4

+ 3 - 5
target/linux/ipq806x/patches-6.12/114-01-devfreq-qcom-Add-L2-Krait-Cache-devfreq-scaling-driv.patch

@@ -51,7 +51,7 @@ Signed-off-by: Christian Marangi <[email protected]>
  obj-$(CONFIG_PM_DEVFREQ_EVENT)		+= event/
 --- /dev/null
 +++ b/drivers/devfreq/krait-cache-devfreq.c
-@@ -0,0 +1,181 @@
+@@ -0,0 +1,179 @@
 +// SPDX-License-Identifier: GPL-2.0
 +
 +#include <linux/kernel.h>
@@ -206,13 +206,11 @@ Signed-off-by: Christian Marangi <[email protected]>
 +	return ret;
 +};
 +
-+static int krait_cache_remove(struct platform_device *pdev)
++static void krait_cache_remove(struct platform_device *pdev)
 +{
 +	struct krait_cache_data *data = dev_get_drvdata(&pdev->dev);
 +
 +	dev_pm_opp_clear_config(data->token);
-+
-+	return 0;
 +};
 +
 +static const struct of_device_id krait_cache_match_table[] = {
@@ -222,7 +220,7 @@ Signed-off-by: Christian Marangi <[email protected]>
 +
 +static struct platform_driver krait_cache_driver = {
 +	.probe		= krait_cache_probe,
-+	.remove		= krait_cache_remove,
++	.remove_new	= krait_cache_remove,
 +	.driver		= {
 +		.name   = "krait-cache-scaling",
 +		.of_match_table = krait_cache_match_table,

+ 3 - 5
target/linux/ipq806x/patches-6.12/115-01-devfreq-add-ipq806x-fabric-scaling-driver.patch

@@ -45,7 +45,7 @@ Signed-off-by: Christian Marangi <[email protected]>
  obj-$(CONFIG_PM_DEVFREQ_EVENT)		+= event/
 --- /dev/null
 +++ b/drivers/devfreq/ipq806x-fab-devfreq.c
-@@ -0,0 +1,155 @@
+@@ -0,0 +1,153 @@
 +// SPDX-License-Identifier: GPL-2.0
 +
 +#include <linux/kernel.h>
@@ -168,7 +168,7 @@ Signed-off-by: Christian Marangi <[email protected]>
 +	return PTR_ERR(clk);
 +};
 +
-+static int ipq806x_fab_remove(struct platform_device *pdev)
++static void ipq806x_fab_remove(struct platform_device *pdev)
 +{
 +	struct ipq806x_fab_data *data = dev_get_drvdata(&pdev->dev);
 +
@@ -179,8 +179,6 @@ Signed-off-by: Christian Marangi <[email protected]>
 +	clk_put(data->ddr_clk);
 +
 +	dev_pm_opp_remove_table(&pdev->dev);
-+
-+	return 0;
 +};
 +
 +static const struct of_device_id ipq806x_fab_match_table[] = {
@@ -190,7 +188,7 @@ Signed-off-by: Christian Marangi <[email protected]>
 +
 +static struct platform_driver ipq806x_fab_driver = {
 +	.probe		= ipq806x_fab_probe,
-+	.remove		= ipq806x_fab_remove,
++	.remove_new	= ipq806x_fab_remove,
 +	.driver		= {
 +		.name   = "ipq806x-fab-scaling",
 +		.of_match_table = ipq806x_fab_match_table,

+ 1 - 1
target/linux/ipq806x/patches-6.12/900-arm-add-cmdline-override.patch

@@ -29,7 +29,7 @@
 +#ifdef CONFIG_CMDLINE_OVERRIDE
 +	p = of_get_flat_dt_prop(node, "bootargs-override", &l);
 +	if (p != NULL && l > 0)
-+		strlcpy(cmdline, p, min((int)l, COMMAND_LINE_SIZE));
++		strscpy(cmdline, p, min((int)l, COMMAND_LINE_SIZE));
 +#endif
 +
  handle_cmdline: