@@ -32,6 +32,7 @@ static const struct regmap_access_table rpcif_volatile_table = {
32
32
};
33
33
34
34
struct rpcif_info {
35
+ const struct regmap_config * regmap_config ;
35
36
enum rpcif_type type ;
36
37
u8 strtim ;
37
38
};
@@ -588,8 +589,8 @@ static int rpcif_probe(struct platform_device *pdev)
588
589
rpc -> base = devm_platform_ioremap_resource_byname (pdev , "regs" );
589
590
if (IS_ERR (rpc -> base ))
590
591
return PTR_ERR (rpc -> base );
591
-
592
- rpc -> regmap = devm_regmap_init (dev , NULL , rpc , & rpcif_regmap_config );
592
+ rpc -> info = of_device_get_match_data ( dev );
593
+ rpc -> regmap = devm_regmap_init (dev , NULL , rpc , rpc -> info -> regmap_config );
593
594
if (IS_ERR (rpc -> regmap )) {
594
595
dev_err (dev , "failed to init regmap for rpcif, error %ld\n" ,
595
596
PTR_ERR (rpc -> regmap ));
@@ -602,7 +603,6 @@ static int rpcif_probe(struct platform_device *pdev)
602
603
return PTR_ERR (rpc -> dirmap );
603
604
604
605
rpc -> size = resource_size (res );
605
- rpc -> info = of_device_get_match_data (dev );
606
606
rpc -> rstc = devm_reset_control_array_get_exclusive (dev );
607
607
if (IS_ERR (rpc -> rstc ))
608
608
return PTR_ERR (rpc -> rstc );
@@ -633,21 +633,25 @@ static void rpcif_remove(struct platform_device *pdev)
633
633
}
634
634
635
635
static const struct rpcif_info rpcif_info_r8a7796 = {
636
+ .regmap_config = & rpcif_regmap_config ,
636
637
.type = RPCIF_RCAR_GEN3 ,
637
638
.strtim = 6 ,
638
639
};
639
640
640
641
static const struct rpcif_info rpcif_info_gen3 = {
642
+ .regmap_config = & rpcif_regmap_config ,
641
643
.type = RPCIF_RCAR_GEN3 ,
642
644
.strtim = 7 ,
643
645
};
644
646
645
647
static const struct rpcif_info rpcif_info_rz_g2l = {
648
+ .regmap_config = & rpcif_regmap_config ,
646
649
.type = RPCIF_RZ_G2L ,
647
650
.strtim = 7 ,
648
651
};
649
652
650
653
static const struct rpcif_info rpcif_info_gen4 = {
654
+ .regmap_config = & rpcif_regmap_config ,
651
655
.type = RPCIF_RCAR_GEN4 ,
652
656
.strtim = 15 ,
653
657
};
0 commit comments