@@ -2148,9 +2148,10 @@ static const struct dev_pm_ops qmp_combo_pm_ops = {
2148
2148
qmp_combo_runtime_resume , NULL )
2149
2149
};
2150
2150
2151
- static int qmp_combo_vreg_init (struct device * dev , const struct qmp_phy_cfg * cfg )
2151
+ static int qmp_combo_vreg_init (struct qmp_combo * qmp )
2152
2152
{
2153
- struct qmp_combo * qmp = dev_get_drvdata (dev );
2153
+ const struct qmp_phy_cfg * cfg = qmp -> cfg ;
2154
+ struct device * dev = qmp -> dev ;
2154
2155
int num = cfg -> num_vregs ;
2155
2156
int ret , i ;
2156
2157
@@ -2180,9 +2181,10 @@ static int qmp_combo_vreg_init(struct device *dev, const struct qmp_phy_cfg *cfg
2180
2181
return 0 ;
2181
2182
}
2182
2183
2183
- static int qmp_combo_reset_init (struct device * dev , const struct qmp_phy_cfg * cfg )
2184
+ static int qmp_combo_reset_init (struct qmp_combo * qmp )
2184
2185
{
2185
- struct qmp_combo * qmp = dev_get_drvdata (dev );
2186
+ const struct qmp_phy_cfg * cfg = qmp -> cfg ;
2187
+ struct device * dev = qmp -> dev ;
2186
2188
int i ;
2187
2189
int ret ;
2188
2190
@@ -2201,9 +2203,10 @@ static int qmp_combo_reset_init(struct device *dev, const struct qmp_phy_cfg *cf
2201
2203
return 0 ;
2202
2204
}
2203
2205
2204
- static int qmp_combo_clk_init (struct device * dev , const struct qmp_phy_cfg * cfg )
2206
+ static int qmp_combo_clk_init (struct qmp_combo * qmp )
2205
2207
{
2206
- struct qmp_combo * qmp = dev_get_drvdata (dev );
2208
+ const struct qmp_phy_cfg * cfg = qmp -> cfg ;
2209
+ struct device * dev = qmp -> dev ;
2207
2210
int num = cfg -> num_clks ;
2208
2211
int i ;
2209
2212
@@ -2468,15 +2471,12 @@ static int phy_dp_clks_register(struct qmp_combo *qmp, struct device_node *np)
2468
2471
return devm_add_action_or_reset (qmp -> dev , phy_clk_release_provider , np );
2469
2472
}
2470
2473
2471
- static int qmp_combo_create_dp (struct device * dev , struct device_node * np ,
2472
- void __iomem * serdes , const struct qmp_phy_cfg * cfg )
2474
+ static int qmp_combo_create_dp (struct qmp_combo * qmp , struct device_node * np )
2473
2475
{
2474
- struct qmp_combo * qmp = dev_get_drvdata ( dev ) ;
2476
+ struct device * dev = qmp -> dev ;
2475
2477
struct phy * generic_phy ;
2476
2478
int ret ;
2477
2479
2478
- qmp -> cfg = cfg ;
2479
- qmp -> dp_serdes = serdes ;
2480
2480
/*
2481
2481
* Get memory resources from the DP child node:
2482
2482
* Resources are indexed as: tx -> 0; rx -> 1; pcs -> 2;
@@ -2509,15 +2509,13 @@ static int qmp_combo_create_dp(struct device *dev, struct device_node *np,
2509
2509
return 0 ;
2510
2510
}
2511
2511
2512
- static int qmp_combo_create_usb (struct device * dev , struct device_node * np ,
2513
- void __iomem * serdes , const struct qmp_phy_cfg * cfg )
2512
+ static int qmp_combo_create_usb (struct qmp_combo * qmp , struct device_node * np )
2514
2513
{
2515
- struct qmp_combo * qmp = dev_get_drvdata (dev );
2514
+ const struct qmp_phy_cfg * cfg = qmp -> cfg ;
2515
+ struct device * dev = qmp -> dev ;
2516
2516
struct phy * generic_phy ;
2517
2517
int ret ;
2518
2518
2519
- qmp -> cfg = cfg ;
2520
- qmp -> serdes = serdes ;
2521
2519
/*
2522
2520
* Get memory resources from the USB child node:
2523
2521
* Resources are indexed as: tx -> 0; rx -> 1; pcs -> 2;
@@ -2577,46 +2575,41 @@ static int qmp_combo_probe(struct platform_device *pdev)
2577
2575
struct device * dev = & pdev -> dev ;
2578
2576
struct device_node * dp_np , * usb_np ;
2579
2577
struct phy_provider * phy_provider ;
2580
- void __iomem * serdes ;
2581
- void __iomem * usb_serdes ;
2582
- void __iomem * dp_serdes = NULL ;
2583
- const struct qmp_phy_cfg * cfg = NULL ;
2584
2578
int ret ;
2585
2579
2586
2580
qmp = devm_kzalloc (dev , sizeof (* qmp ), GFP_KERNEL );
2587
2581
if (!qmp )
2588
2582
return - ENOMEM ;
2589
2583
2590
2584
qmp -> dev = dev ;
2591
- dev_set_drvdata (dev , qmp );
2592
2585
2593
- cfg = of_device_get_match_data (dev );
2594
- if (!cfg )
2586
+ qmp -> cfg = of_device_get_match_data (dev );
2587
+ if (!qmp -> cfg )
2595
2588
return - EINVAL ;
2596
2589
2597
- usb_serdes = serdes = devm_platform_ioremap_resource (pdev , 0 );
2598
- if (IS_ERR (serdes ))
2599
- return PTR_ERR (serdes );
2590
+ qmp -> serdes = devm_platform_ioremap_resource (pdev , 0 );
2591
+ if (IS_ERR (qmp -> serdes ))
2592
+ return PTR_ERR (qmp -> serdes );
2600
2593
2601
2594
qmp -> dp_com = devm_platform_ioremap_resource (pdev , 1 );
2602
2595
if (IS_ERR (qmp -> dp_com ))
2603
2596
return PTR_ERR (qmp -> dp_com );
2604
2597
2605
- dp_serdes = devm_platform_ioremap_resource (pdev , 2 );
2606
- if (IS_ERR (dp_serdes ))
2607
- return PTR_ERR (dp_serdes );
2598
+ qmp -> dp_serdes = devm_platform_ioremap_resource (pdev , 2 );
2599
+ if (IS_ERR (qmp -> dp_serdes ))
2600
+ return PTR_ERR (qmp -> dp_serdes );
2608
2601
2609
2602
mutex_init (& qmp -> phy_mutex );
2610
2603
2611
- ret = qmp_combo_clk_init (dev , cfg );
2604
+ ret = qmp_combo_clk_init (qmp );
2612
2605
if (ret )
2613
2606
return ret ;
2614
2607
2615
- ret = qmp_combo_reset_init (dev , cfg );
2608
+ ret = qmp_combo_reset_init (qmp );
2616
2609
if (ret )
2617
2610
return ret ;
2618
2611
2619
- ret = qmp_combo_vreg_init (dev , cfg );
2612
+ ret = qmp_combo_vreg_init (qmp );
2620
2613
if (ret )
2621
2614
return ret ;
2622
2615
@@ -2640,15 +2633,15 @@ static int qmp_combo_probe(struct platform_device *pdev)
2640
2633
*/
2641
2634
pm_runtime_forbid (dev );
2642
2635
2643
- ret = qmp_combo_create_usb (dev , usb_np , usb_serdes , cfg );
2636
+ ret = qmp_combo_create_usb (qmp , usb_np );
2644
2637
if (ret )
2645
2638
goto err_node_put ;
2646
2639
2647
2640
ret = phy_pipe_clk_register (qmp , usb_np );
2648
2641
if (ret )
2649
2642
goto err_node_put ;
2650
2643
2651
- ret = qmp_combo_create_dp (dev , dp_np , dp_serdes , cfg );
2644
+ ret = qmp_combo_create_dp (qmp , dp_np );
2652
2645
if (ret )
2653
2646
goto err_node_put ;
2654
2647
0 commit comments