forked from Mirrors/opensbi
lib: utils/gpio: Use fdt_driver for initialization
FDT gpio drivers have an extra .xlate operation, so they need to embed the `struct fdt_driver` inside the subsystem-specific type. The gpio subsystem always initializes the driver for a specific DT node. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:

committed by
Anup Patel

parent
10df2d6fb5
commit
bef8f9b806
@@ -69,7 +69,7 @@ static void starfive_gpio_set(struct gpio_pin *gp, int value)
|
||||
writel(val, (void *)(reg_addr + STARFIVE_GPIO_OUTVAL));
|
||||
}
|
||||
|
||||
extern struct fdt_gpio fdt_gpio_starfive;
|
||||
const struct fdt_gpio fdt_gpio_starfive;
|
||||
|
||||
static int starfive_gpio_init(const void *fdt, int nodeoff,
|
||||
const struct fdt_match *match)
|
||||
@@ -109,8 +109,10 @@ static const struct fdt_match starfive_gpio_match[] = {
|
||||
{ },
|
||||
};
|
||||
|
||||
struct fdt_gpio fdt_gpio_starfive = {
|
||||
.match_table = starfive_gpio_match,
|
||||
const struct fdt_gpio fdt_gpio_starfive = {
|
||||
.driver = {
|
||||
.match_table = starfive_gpio_match,
|
||||
.init = starfive_gpio_init,
|
||||
},
|
||||
.xlate = fdt_gpio_simple_xlate,
|
||||
.init = starfive_gpio_init,
|
||||
};
|
||||
|
Reference in New Issue
Block a user