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
@@ -30,7 +30,7 @@ struct dw_gpio_chip {
|
||||
struct gpio_chip chip;
|
||||
};
|
||||
|
||||
extern struct fdt_gpio fdt_gpio_designware;
|
||||
const struct fdt_gpio fdt_gpio_designware;
|
||||
|
||||
#define pin_to_chip(__p) container_of((__p)->chip, struct dw_gpio_chip, chip);
|
||||
|
||||
@@ -132,8 +132,10 @@ static const struct fdt_match dw_gpio_match[] = {
|
||||
{ },
|
||||
};
|
||||
|
||||
struct fdt_gpio fdt_gpio_designware = {
|
||||
.match_table = dw_gpio_match,
|
||||
const struct fdt_gpio fdt_gpio_designware = {
|
||||
.driver = {
|
||||
.match_table = dw_gpio_match,
|
||||
.init = dw_gpio_init_bank,
|
||||
},
|
||||
.xlate = fdt_gpio_simple_xlate,
|
||||
.init = dw_gpio_init_bank,
|
||||
};
|
||||
|
Reference in New Issue
Block a user