[PATCH 9/9] MIPS: TXX9: Clean up txx9_iocled_init()

From: Geert Uytterhoeven

Date: Thu Jun 25 2026 - 08:32:29 EST


The sole caller already uses dynamic GPIO base allocation, so drop
support for static allocation.
While at it, drop the no longer used "lowactive" parameter.

Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
---
arch/mips/include/asm/txx9/generic.h | 3 +--
arch/mips/txx9/generic/setup.c | 12 ++++--------
arch/mips/txx9/rbtx4927/setup.c | 2 +-
3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/arch/mips/include/asm/txx9/generic.h b/arch/mips/include/asm/txx9/generic.h
index 5ce5b8579a444ec3..653315fb6ca559a7 100644
--- a/arch/mips/include/asm/txx9/generic.h
+++ b/arch/mips/include/asm/txx9/generic.h
@@ -79,8 +79,7 @@ static inline unsigned int __fls8(unsigned char x)
return r;
}

-void txx9_iocled_init(unsigned long baseaddr,
- int basenum, unsigned int num, int lowactive,
+void txx9_iocled_init(unsigned long baseaddr, unsigned int num,
const char *color, char **deftriggers);

void __init txx9_aclc_init(unsigned long baseaddr, int irq,
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 32246f5f78f5070c..5f66236038c8f468 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -625,8 +625,7 @@ static struct gpiod_lookup_table txx9_iocled_table = {
},
};

-void __init txx9_iocled_init(unsigned long baseaddr,
- int basenum, unsigned int num, int lowactive,
+void __init txx9_iocled_init(unsigned long baseaddr, unsigned int num,
const char *color, char **deftriggers)
{
struct txx9_iocled_data *iocled;
@@ -652,14 +651,12 @@ void __init txx9_iocled_init(unsigned long baseaddr,
iocled->chip.direction_input = txx9_iocled_dir_in;
iocled->chip.direction_output = txx9_iocled_dir_out;
iocled->chip.label = "iocled";
- iocled->chip.base = basenum;
+ iocled->chip.base = -1;
iocled->chip.ngpio = num;
if (gpiochip_add_data(&iocled->chip, iocled))
goto out_unmap;
- if (basenum < 0)
- basenum = iocled->chip.base;

- pdev = platform_device_alloc("leds-gpio", basenum);
+ pdev = platform_device_alloc("leds-gpio", iocled->chip.base);
if (!pdev)
goto out_gpio;
iocled->pdata.num_leds = num;
@@ -689,8 +686,7 @@ void __init txx9_iocled_init(unsigned long baseaddr,
kfree(iocled);
}
#else /* CONFIG_LEDS_GPIO */
-void __init txx9_iocled_init(unsigned long baseaddr,
- int basenum, unsigned int num, int lowactive,
+void __init txx9_iocled_init(unsigned long baseaddr, unsigned int num,
const char *color, char **deftriggers)
{
}
diff --git a/arch/mips/txx9/rbtx4927/setup.c b/arch/mips/txx9/rbtx4927/setup.c
index 5b69bff99510e214..51c06c5090f1abcd 100644
--- a/arch/mips/txx9/rbtx4927/setup.c
+++ b/arch/mips/txx9/rbtx4927/setup.c
@@ -370,7 +370,7 @@ static void __init rbtx4927_device_init(void)
tx4938_aclc_init();
}
platform_device_register_simple("txx9aclc-generic", -1, NULL, 0);
- txx9_iocled_init(RBTX4927_LED_ADDR - IO_BASE, -1, 3, 1, "green", NULL);
+ txx9_iocled_init(RBTX4927_LED_ADDR - IO_BASE, 3, "green", NULL);
rbtx4927_gpioled_init();
}

--
2.43.0