Skip to content

Commit 9dc9667

Browse files
Ali Tariqlinusw
authored andcommitted
pinctrl: starfive: use dynamic GPIO base allocation
The JH7110 pinctrl driver currently sets a static GPIO base number from platform data: sfp->gc.base = info->gc_base; Static base assignment is deprecated and results in the following warning: gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation. Set `sfp->gc.base = -1` to let the GPIO core dynamically allocate the base number. This removes the warning and aligns the driver with current GPIO guidelines. Since the GPIO base is now allocated dynamically, remove `gc_base` field in `struct jh7110_pinctrl_soc_info` and the associated `JH7110_SYS_GC_BASE` and `JH7110_AON_GC_BASE` constants as they are no longer used anywhere in the driver. Tested on VisionFive 2 (JH7110 SoC). Signed-off-by: Ali Tariq <alitariq45892@gmail.com> Reviewed-by: Emil Renner Berthing <emil.renner.berthing@canonical.com> Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
1 parent 61d1bb5 commit 9dc9667

4 files changed

Lines changed: 1 addition & 6 deletions

File tree

drivers/pinctrl/starfive/pinctrl-starfive-jh7110-aon.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "pinctrl-starfive-jh7110.h"
3030

3131
#define JH7110_AON_NGPIO 4
32-
#define JH7110_AON_GC_BASE 64
3332

3433
#define JH7110_AON_REGS_NUM 37
3534

@@ -138,7 +137,6 @@ static const struct jh7110_pinctrl_soc_info jh7110_aon_pinctrl_info = {
138137
.pins = jh7110_aon_pins,
139138
.npins = ARRAY_SIZE(jh7110_aon_pins),
140139
.ngpios = JH7110_AON_NGPIO,
141-
.gc_base = JH7110_AON_GC_BASE,
142140
.dout_reg_base = JH7110_AON_DOUT,
143141
.dout_mask = GENMASK(3, 0),
144142
.doen_reg_base = JH7110_AON_DOEN,

drivers/pinctrl/starfive/pinctrl-starfive-jh7110-sys.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "pinctrl-starfive-jh7110.h"
3030

3131
#define JH7110_SYS_NGPIO 64
32-
#define JH7110_SYS_GC_BASE 0
3332

3433
#define JH7110_SYS_REGS_NUM 174
3534

@@ -410,7 +409,6 @@ static const struct jh7110_pinctrl_soc_info jh7110_sys_pinctrl_info = {
410409
.pins = jh7110_sys_pins,
411410
.npins = ARRAY_SIZE(jh7110_sys_pins),
412411
.ngpios = JH7110_SYS_NGPIO,
413-
.gc_base = JH7110_SYS_GC_BASE,
414412
.dout_reg_base = JH7110_SYS_DOUT,
415413
.dout_mask = GENMASK(6, 0),
416414
.doen_reg_base = JH7110_SYS_DOEN,

drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ int jh7110_pinctrl_probe(struct platform_device *pdev)
938938
sfp->gc.set = jh7110_gpio_set;
939939
sfp->gc.set_config = jh7110_gpio_set_config;
940940
sfp->gc.add_pin_ranges = jh7110_gpio_add_pin_ranges;
941-
sfp->gc.base = info->gc_base;
941+
sfp->gc.base = -1;
942942
sfp->gc.ngpio = info->ngpios;
943943

944944
jh7110_irq_chip.name = sfp->gc.label;

drivers/pinctrl/starfive/pinctrl-starfive-jh7110.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ struct jh7110_pinctrl_soc_info {
3838
const struct pinctrl_pin_desc *pins;
3939
unsigned int npins;
4040
unsigned int ngpios;
41-
unsigned int gc_base;
4241

4342
/* gpio dout/doen/din/gpioinput register */
4443
unsigned int dout_reg_base;

0 commit comments

Comments
 (0)