5
5
#include <linux/init.h>
6
6
#include <linux/module.h>
7
7
#include <linux/platform_device.h>
8
+ #include <linux/property.h>
8
9
#include <linux/err.h>
9
10
#include <linux/io.h>
10
11
#include <linux/of.h>
11
- #include <linux/of_device.h>
12
12
#include <linux/clk.h>
13
13
#include <linux/clk-provider.h>
14
14
#include <linux/slab.h>
@@ -347,22 +347,18 @@ MODULE_DEVICE_TABLE(of, krait_cc_match_table);
347
347
static int krait_cc_probe (struct platform_device * pdev )
348
348
{
349
349
struct device * dev = & pdev -> dev ;
350
- const struct of_device_id * id ;
351
350
unsigned long cur_rate , aux_rate ;
352
351
int cpu ;
353
352
struct clk_hw * mux , * l2_pri_mux ;
354
353
struct clk * clk , * * clks ;
355
-
356
- id = of_match_device (krait_cc_match_table , dev );
357
- if (!id )
358
- return - ENODEV ;
354
+ bool unique_aux = !!device_get_match_data (dev );
359
355
360
356
/* Rate is 1 because 0 causes problems for __clk_mux_determine_rate */
361
357
clk = clk_register_fixed_rate (dev , "qsb" , NULL , 0 , 1 );
362
358
if (IS_ERR (clk ))
363
359
return PTR_ERR (clk );
364
360
365
- if (!id -> data ) {
361
+ if (!unique_aux ) {
366
362
clk = clk_register_fixed_factor (dev , "acpu_aux" ,
367
363
"gpll0_vote" , 0 , 1 , 2 );
368
364
if (IS_ERR (clk ))
@@ -375,13 +371,13 @@ static int krait_cc_probe(struct platform_device *pdev)
375
371
return - ENOMEM ;
376
372
377
373
for_each_possible_cpu (cpu ) {
378
- mux = krait_add_clks (dev , cpu , id -> data );
374
+ mux = krait_add_clks (dev , cpu , unique_aux );
379
375
if (IS_ERR (mux ))
380
376
return PTR_ERR (mux );
381
377
clks [cpu ] = mux -> clk ;
382
378
}
383
379
384
- l2_pri_mux = krait_add_clks (dev , -1 , id -> data );
380
+ l2_pri_mux = krait_add_clks (dev , -1 , unique_aux );
385
381
if (IS_ERR (l2_pri_mux ))
386
382
return PTR_ERR (l2_pri_mux );
387
383
clks [l2_mux ] = l2_pri_mux -> clk ;
0 commit comments