File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -667,8 +667,9 @@ static int rockchip_get_bank_data(struct rockchip_pin_bank *bank)
667
667
clk_prepare_enable (bank -> clk );
668
668
id = readl (bank -> reg_base + gpio_regs_v2 .version_id );
669
669
670
- /* If not gpio v2, that is default to v1. */
671
- if (id == GPIO_TYPE_V2 || id == GPIO_TYPE_V2_1 ) {
670
+ switch (id ) {
671
+ case GPIO_TYPE_V2 :
672
+ case GPIO_TYPE_V2_1 :
672
673
bank -> gpio_regs = & gpio_regs_v2 ;
673
674
bank -> gpio_type = GPIO_TYPE_V2 ;
674
675
bank -> db_clk = of_clk_get (bank -> of_node , 1 );
@@ -677,9 +678,14 @@ static int rockchip_get_bank_data(struct rockchip_pin_bank *bank)
677
678
clk_disable_unprepare (bank -> clk );
678
679
return - EINVAL ;
679
680
}
680
- } else {
681
+ break ;
682
+ case GPIO_TYPE_V1 :
681
683
bank -> gpio_regs = & gpio_regs_v1 ;
682
684
bank -> gpio_type = GPIO_TYPE_V1 ;
685
+ break ;
686
+ default :
687
+ dev_err (bank -> dev , "unsupported version ID: 0x%08x\n" , id );
688
+ return - ENODEV ;
683
689
}
684
690
685
691
return 0 ;
You can’t perform that action at this time.
0 commit comments