linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev,
	"Linux Memory Management List" <linux-mm@kvack.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"kernel test robot" <lkp@intel.com>
Subject: Re: [linux-next:master 11606/12643] arm-linux-gnueabi-ld: arch/arm/mach-pxa/devices.o:undefined reference to `gpio_set_wake'
Date: Fri, 12 Jul 2024 08:41:58 +0200	[thread overview]
Message-ID: <0de0aeba-da02-4fa6-a1f8-a468dcbfac58@app.fastmail.com> (raw)
In-Reply-To: <ZpC_xsx0t9KFgCCh@google.com>

On Fri, Jul 12, 2024, at 07:31, Dmitry Torokhov wrote:
> @@ -684,6 +685,7 @@ struct platform_device pxa27x_device_gpio = {
>  		.platform_data	= &pxa2xx_gpio_info,
>  	},
>  };
> +#endif /* CONFIG_PXA25x || CONFIG_PXA27x */
> 
>  static struct resource pxa_dma_resource[] = {
>  	[0] = {
>
> If you are OK with this I'll submit proper patch.

Right, that's probably the easiest way. I was trying a more
elaborate change (see below), but there is a good chance I
introduce another regression in that, so let's go with
your patch. Please send it directly to soc@kernel.org
Cc:linux-arm-kernel and I'll pick it up.

One more thing I noticed: if you are doing more patches
to convert devices in board files to use software nodes,
we should probably try to move them away from static
platform_device definitions towards a dynamic
platform_device_register_simple() or similar interface
at the same time.

    Arnd


diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index d050a4c78f97..8813a5d179ed 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -633,58 +633,6 @@ struct platform_device pxa27x_device_pwm1 = {
 };
 #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
 
-const struct software_node pxa2xx_gpiochip_node = {
-	.name	= "gpio-pxa",
-};
-
-struct resource pxa_resource_gpio[] = {
-	{
-		.start	= 0x40e00000,
-		.end	= 0x40e0ffff,
-		.flags	= IORESOURCE_MEM,
-	}, {
-		.start	= IRQ_GPIO0,
-		.end	= IRQ_GPIO0,
-		.name	= "gpio0",
-		.flags	= IORESOURCE_IRQ,
-	}, {
-		.start	= IRQ_GPIO1,
-		.end	= IRQ_GPIO1,
-		.name	= "gpio1",
-		.flags	= IORESOURCE_IRQ,
-	}, {
-		.start	= IRQ_GPIO_2_x,
-		.end	= IRQ_GPIO_2_x,
-		.name	= "gpio_mux",
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct pxa_gpio_platform_data pxa2xx_gpio_info = {
-	.irq_base	= PXA_GPIO_TO_IRQ(0),
-	.gpio_set_wake	= gpio_set_wake,
-};
-
-struct platform_device pxa25x_device_gpio = {
-	.name		= "pxa25x-gpio",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(pxa_resource_gpio),
-	.resource	= pxa_resource_gpio,
-	.dev		= {
-		.platform_data	= &pxa2xx_gpio_info,
-	},
-};
-
-struct platform_device pxa27x_device_gpio = {
-	.name		= "pxa27x-gpio",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(pxa_resource_gpio),
-	.resource	= pxa_resource_gpio,
-	.dev		= {
-		.platform_data	= &pxa2xx_gpio_info,
-	},
-};
-
 static struct resource pxa_dma_resource[] = {
 	[0] = {
 		.start	= 0x40000000,
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c
index f5a3d890f682..e0ac1f525f77 100644
--- a/arch/arm/mach-pxa/mfp-pxa2xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa2xx.c
@@ -15,12 +15,16 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/ioport.h>
+#include <linux/property.h>
+#include <linux/platform_device.h>
 #include <linux/syscore_ops.h>
 #include <linux/soc/pxa/cpu.h>
 
 #include "pxa2xx-regs.h"
 #include "mfp-pxa2xx.h"
 #include "mfp-pxa27x.h"
+#include "irqs.h"
 
 #include "generic.h"
 
@@ -151,24 +155,6 @@ void pxa2xx_mfp_config(unsigned long *mfp_cfgs, int num)
 	}
 }
 
-void pxa2xx_mfp_set_lpm(int mfp, unsigned long lpm)
-{
-	unsigned long flags, c;
-	int gpio;
-
-	gpio = __mfp_validate(mfp);
-	if (gpio < 0)
-		return;
-
-	local_irq_save(flags);
-
-	c = gpio_desc[gpio].config;
-	c = (c & ~MFP_LPM_STATE_MASK) | lpm;
-	__mfp_config_gpio(gpio, c);
-
-	local_irq_restore(flags);
-}
-
 int gpio_set_wake(unsigned int gpio, unsigned int on)
 {
 	struct gpio_desc *d;
@@ -221,7 +207,49 @@ int gpio_set_wake(unsigned int gpio, unsigned int on)
 	return 0;
 }
 
+const struct software_node pxa2xx_gpiochip_node = {
+	.name	= "gpio-pxa",
+};
+
+struct resource pxa_resource_gpio[] = {
+	{
+		.start	= 0x40e00000,
+		.end	= 0x40e0ffff,
+		.flags	= IORESOURCE_MEM,
+	}, {
+		.start	= IRQ_GPIO0,
+		.end	= IRQ_GPIO0,
+		.name	= "gpio0",
+		.flags	= IORESOURCE_IRQ,
+	}, {
+		.start	= IRQ_GPIO1,
+		.end	= IRQ_GPIO1,
+		.name	= "gpio1",
+		.flags	= IORESOURCE_IRQ,
+	}, {
+		.start	= IRQ_GPIO_2_x,
+		.end	= IRQ_GPIO_2_x,
+		.name	= "gpio_mux",
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct pxa_gpio_platform_data pxa2xx_gpio_info = {
+	.irq_base	= PXA_GPIO_TO_IRQ(0),
+	.gpio_set_wake	= gpio_set_wake,
+};
+
 #ifdef CONFIG_PXA25x
+struct platform_device pxa25x_device_gpio = {
+	.name		= "pxa25x-gpio",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(pxa_resource_gpio),
+	.resource	= pxa_resource_gpio,
+	.dev		= {
+		.platform_data	= &pxa2xx_gpio_info,
+	},
+};
+
 static void __init pxa25x_mfp_init(void)
 {
 	int i;
@@ -247,6 +275,16 @@ static inline void pxa25x_mfp_init(void) {}
 #endif /* CONFIG_PXA25x */
 
 #ifdef CONFIG_PXA27x
+struct platform_device pxa27x_device_gpio = {
+	.name		= "pxa27x-gpio",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(pxa_resource_gpio),
+	.resource	= pxa_resource_gpio,
+	.dev		= {
+		.platform_data	= &pxa2xx_gpio_info,
+	},
+};
+
 static int pxa27x_pkwr_gpio[] = {
 	13, 16, 17, 34, 36, 37, 38, 39, 90, 91, 93, 94,
 	95, 96, 97, 98, 99, 100, 101, 102


  reply	other threads:[~2024-07-12  6:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11 13:02 [linux-next:master 11606/12643] arm-linux-gnueabi-ld: arch/arm/mach-pxa/devices.o:undefined reference to `gpio_set_wake' kernel test robot
2024-07-12  5:31 ` Dmitry Torokhov
2024-07-12  6:41   ` Arnd Bergmann [this message]
2024-07-13  3:38     ` Dmitry Torokhov
2024-07-15 12:42       ` Arnd Bergmann
2024-07-15 12:44         ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0de0aeba-da02-4fa6-a1f8-a468dcbfac58@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).