@@ -2177,11 +2177,6 @@ static int atcphy_parse_legacy_tunable(struct apple_atcphy *atcphy,
21772177 const __le32 * p = NULL ;
21782178 int i ;
21792179
2180- #if 0
2181- WARN_TAINT_ONCE (1 , TAINT_FIRMWARE_WORKAROUND ,
2182- "parsing legacy tunable; please update m1n1" );
2183- #endif
2184-
21852180 prop = of_find_property (atcphy -> np , name , NULL );
21862181 if (!prop ) {
21872182 dev_err (atcphy -> dev , "tunable %s not found\n" , name );
@@ -2208,88 +2203,16 @@ static int atcphy_parse_legacy_tunable(struct apple_atcphy *atcphy,
22082203 return 0 ;
22092204}
22102205
2211- static int atcphy_parse_new_tunable (struct apple_atcphy * atcphy ,
2212- struct atcphy_tunable * tunable ,
2213- const char * name )
2214- {
2215- struct property * prop ;
2216- u64 * fdt_tunable ;
2217- int ret , i ;
2218-
2219- prop = of_find_property (atcphy -> np , name , NULL );
2220- if (!prop ) {
2221- dev_err (atcphy -> dev , "tunable %s not found\n" , name );
2222- return - ENOENT ;
2223- }
2224-
2225- if (prop -> length % (4 * sizeof (u64 )))
2226- return - EINVAL ;
2227-
2228- fdt_tunable = kzalloc (prop -> length , GFP_KERNEL );
2229- if (!fdt_tunable )
2230- return - ENOMEM ;
2231-
2232- tunable -> sz = prop -> length / (4 * sizeof (u64 ));
2233- ret = of_property_read_variable_u64_array (atcphy -> np , name , fdt_tunable ,
2234- tunable -> sz , tunable -> sz );
2235- if (ret < 0 )
2236- goto err_free_fdt ;
2237-
2238- tunable -> values = devm_kcalloc (atcphy -> dev , tunable -> sz ,
2239- sizeof (* tunable -> values ), GFP_KERNEL );
2240- if (!tunable -> values ) {
2241- ret = - ENOMEM ;
2242- goto err_free_fdt ;
2243- }
2244-
2245- for (i = 0 ; i < tunable -> sz ; ++ i ) {
2246- u32 offset , size , mask , value ;
2247-
2248- offset = fdt_tunable [4 * i ];
2249- size = fdt_tunable [4 * i + 1 ];
2250- mask = fdt_tunable [4 * i + 2 ];
2251- value = fdt_tunable [4 * i + 3 ];
2252-
2253- if (offset > U32_MAX || size != 4 || mask > U32_MAX ||
2254- value > U32_MAX ) {
2255- ret = - EINVAL ;
2256- goto err_free_values ;
2257- }
2258-
2259- tunable -> values [i ].offset = offset ;
2260- tunable -> values [i ].mask = mask ;
2261- tunable -> values [i ].value = value ;
2262- }
2263-
2264- trace_atcphy_parsed_tunable (name , tunable );
2265- kfree (fdt_tunable );
2266-
2267- BUG_ON (1 );
2268- return 0 ;
2269-
2270- err_free_values :
2271- devm_kfree (atcphy -> dev , tunable -> values );
2272- err_free_fdt :
2273- kfree (fdt_tunable );
2274- return ret ;
2275- }
2276-
22772206static int atcphy_parse_tunable (struct apple_atcphy * atcphy ,
22782207 struct atcphy_tunable * tunable ,
22792208 const char * name )
22802209{
2281- int ret ;
2282-
22832210 if (!of_find_property (atcphy -> np , name , NULL )) {
22842211 dev_err (atcphy -> dev , "tunable %s not found\n" , name );
22852212 return - ENOENT ;
22862213 }
22872214
2288- ret = atcphy_parse_new_tunable (atcphy , tunable , name );
2289- if (ret )
2290- ret = atcphy_parse_legacy_tunable (atcphy , tunable , name );
2291-
2292- return ret ;
2215+ return atcphy_parse_legacy_tunable (atcphy , tunable , name );
22932216}
22942217
22952218static int atcphy_load_tunables (struct apple_atcphy * atcphy )
0 commit comments