@@ -65,15 +65,15 @@ struct qcom_icc_node {
6565};
6666
6767struct qcom_icc_desc {
68- struct qcom_icc_node * * nodes ;
68+ const struct qcom_icc_node * * nodes ;
6969 size_t num_nodes ;
7070 unsigned int lut_row_size ;
7171 unsigned int reg_freq_lut ;
7272 unsigned int reg_perf_state ;
7373};
7474
7575#define DEFINE_QNODE (_name , _id , _buswidth , ...) \
76- static struct qcom_icc_node _name = { \
76+ static const struct qcom_icc_node _name = { \
7777 .name = #_name, \
7878 .id = _id, \
7979 .buswidth = _buswidth, \
@@ -84,7 +84,7 @@ struct qcom_icc_desc {
8484DEFINE_QNODE (sdm845_osm_apps_l3 , SDM845_MASTER_OSM_L3_APPS , 16 , SDM845_SLAVE_OSM_L3 );
8585DEFINE_QNODE (sdm845_osm_l3 , SDM845_SLAVE_OSM_L3 , 16 );
8686
87- static struct qcom_icc_node * sdm845_osm_l3_nodes [] = {
87+ static const struct qcom_icc_node * sdm845_osm_l3_nodes [] = {
8888 [MASTER_OSM_L3_APPS ] = & sdm845_osm_apps_l3 ,
8989 [SLAVE_OSM_L3 ] = & sdm845_osm_l3 ,
9090};
@@ -100,7 +100,7 @@ static const struct qcom_icc_desc sdm845_icc_osm_l3 = {
100100DEFINE_QNODE (sc7180_osm_apps_l3 , SC7180_MASTER_OSM_L3_APPS , 16 , SC7180_SLAVE_OSM_L3 );
101101DEFINE_QNODE (sc7180_osm_l3 , SC7180_SLAVE_OSM_L3 , 16 );
102102
103- static struct qcom_icc_node * sc7180_osm_l3_nodes [] = {
103+ static const struct qcom_icc_node * sc7180_osm_l3_nodes [] = {
104104 [MASTER_OSM_L3_APPS ] = & sc7180_osm_apps_l3 ,
105105 [SLAVE_OSM_L3 ] = & sc7180_osm_l3 ,
106106};
@@ -116,7 +116,7 @@ static const struct qcom_icc_desc sc7180_icc_osm_l3 = {
116116DEFINE_QNODE (sm8150_osm_apps_l3 , SM8150_MASTER_OSM_L3_APPS , 32 , SM8150_SLAVE_OSM_L3 );
117117DEFINE_QNODE (sm8150_osm_l3 , SM8150_SLAVE_OSM_L3 , 32 );
118118
119- static struct qcom_icc_node * sm8150_osm_l3_nodes [] = {
119+ static const struct qcom_icc_node * sm8150_osm_l3_nodes [] = {
120120 [MASTER_OSM_L3_APPS ] = & sm8150_osm_apps_l3 ,
121121 [SLAVE_OSM_L3 ] = & sm8150_osm_l3 ,
122122};
@@ -132,7 +132,7 @@ static const struct qcom_icc_desc sm8150_icc_osm_l3 = {
132132DEFINE_QNODE (sm8250_epss_apps_l3 , SM8250_MASTER_EPSS_L3_APPS , 32 , SM8250_SLAVE_EPSS_L3 );
133133DEFINE_QNODE (sm8250_epss_l3 , SM8250_SLAVE_EPSS_L3 , 32 );
134134
135- static struct qcom_icc_node * sm8250_epss_l3_nodes [] = {
135+ static const struct qcom_icc_node * sm8250_epss_l3_nodes [] = {
136136 [MASTER_EPSS_L3_APPS ] = & sm8250_epss_apps_l3 ,
137137 [SLAVE_EPSS_L3_SHARED ] = & sm8250_epss_l3 ,
138138};
@@ -149,7 +149,7 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst)
149149{
150150 struct qcom_osm_l3_icc_provider * qp ;
151151 struct icc_provider * provider ;
152- struct qcom_icc_node * qn ;
152+ const struct qcom_icc_node * qn ;
153153 struct icc_node * n ;
154154 unsigned int index ;
155155 u32 agg_peak = 0 ;
@@ -194,7 +194,7 @@ static int qcom_osm_l3_probe(struct platform_device *pdev)
194194 const struct qcom_icc_desc * desc ;
195195 struct icc_onecell_data * data ;
196196 struct icc_provider * provider ;
197- struct qcom_icc_node * * qnodes ;
197+ const struct qcom_icc_node * * qnodes ;
198198 struct icc_node * node ;
199199 size_t num_nodes ;
200200 struct clk * clk ;
@@ -286,7 +286,8 @@ static int qcom_osm_l3_probe(struct platform_device *pdev)
286286 }
287287
288288 node -> name = qnodes [i ]-> name ;
289- node -> data = qnodes [i ];
289+ /* Cast away const and add it back in qcom_icc_set() */
290+ node -> data = (void * )qnodes [i ];
290291 icc_node_add (node , provider );
291292
292293 for (j = 0 ; j < qnodes [i ]-> num_links ; j ++ )
0 commit comments