ipq806x: fix build errors on 6.12 kernel
authorShiji Yang <[email protected]>
Sat, 31 May 2025 16:41:31 +0000 (00:41 +0800)
committerChristian Marangi <[email protected]>
Tue, 14 Oct 2025 08:27:26 +0000 (10:27 +0200)
- 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]>
target/linux/ipq806x/patches-6.12/114-01-devfreq-qcom-Add-L2-Krait-Cache-devfreq-scaling-driv.patch
target/linux/ipq806x/patches-6.12/115-01-devfreq-add-ipq806x-fabric-scaling-driver.patch
target/linux/ipq806x/patches-6.12/900-arm-add-cmdline-override.patch

index 9780f6a30b8792803a06922c7dc089e116486299..82a0a833f156048946763fc6b15b6294e99f6d8f 100644 (file)
@@ -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,
index c359eda2a5102324d0476564504b3e9871c98c09..67dab1a6e6f731806a5f7239c60b8430213d32d3 100644 (file)
@@ -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,
index 0d87770486aa82d2952ef404aaeaad1b0df92100..cd5c8c016da78a3daa4f2baec12c96bb7078e4cd 100644 (file)
@@ -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: