[RFC PATCH 08/23] net: sunxi_emac: Remove non-DM pin setup

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Tue Nov 9 16:33:02 CET 2021


On 10/21/21 06:55, Samuel Holland wrote:
> This is now handled automatically by the pinctrl driver.
> 
> Signed-off-by: Samuel Holland <samuel at sholland.org>
> ---
> 
>   arch/arm/include/asm/arch-sunxi/gpio.h | 1 -
>   drivers/net/sunxi_emac.c               | 5 -----
>   2 files changed, 6 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h
> index fa99b1ca84..13bc85fecf 100644
> --- a/arch/arm/include/asm/arch-sunxi/gpio.h
> +++ b/arch/arm/include/asm/arch-sunxi/gpio.h
> @@ -135,7 +135,6 @@ enum sunxi_gpio_number {
>   #define SUNXI_GPIO_OUTPUT	1
>   #define SUNXI_GPIO_DISABLE	7
>   
> -#define SUNXI_GPA_EMAC		2
>   #define SUN6I_GPA_GMAC		2
>   #define SUN7I_GPA_GMAC		5
>   #define SUN8I_H3_GPA_UART0	2
> diff --git a/drivers/net/sunxi_emac.c b/drivers/net/sunxi_emac.c
> index 17ad88e732..9c68ee533b 100644
> --- a/drivers/net/sunxi_emac.c
> +++ b/drivers/net/sunxi_emac.c
> @@ -17,7 +17,6 @@
>   #include <net.h>
>   #include <asm/io.h>
>   #include <asm/arch/clock.h>
> -#include <asm/arch/gpio.h>
>   
>   /* EMAC register  */
>   struct emac_regs {
> @@ -516,10 +515,6 @@ static int sunxi_emac_board_setup(struct udevice *dev,
>   	/* Map SRAM to EMAC */
>   	setbits_le32(&sram->ctrl1, 0x5 << 2);
>   
> -	/* Configure pin mux settings for MII Ethernet */
> -	for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(17); pin++)
> -		sunxi_gpio_set_cfgpin(pin, SUNXI_GPA_EMAC);
> -

This leads to an error:

+drivers/net/sunxi_emac.c: In function 'sunxi_emac_board_setup':
+drivers/net/sunxi_emac.c:513:13: error: unused variable 'pin' 
[-Werror=unused-variable]
+  513 |         int pin, ret;
+      |             ^~~

Please, remove the unused variable.

Best regards

Heinrich

>   	/* Set up clock gating */
>   	ret = clk_enable(&priv->clk);
>   	if (ret) {
> 



More information about the U-Boot mailing list