@@ -28,7 +28,6 @@ struct pwm_bl_data {
28
28
struct regulator * power_supply ;
29
29
struct gpio_desc * enable_gpio ;
30
30
unsigned int scale ;
31
- bool legacy ;
32
31
unsigned int post_pwm_on_delay ;
33
32
unsigned int pwm_off_delay ;
34
33
int (* notify )(struct device * ,
@@ -455,7 +454,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
455
454
struct platform_pwm_backlight_data defdata ;
456
455
struct backlight_properties props ;
457
456
struct backlight_device * bl ;
458
- struct device_node * node = pdev -> dev .of_node ;
459
457
struct pwm_bl_data * pb ;
460
458
struct pwm_state state ;
461
459
unsigned int i ;
@@ -506,12 +504,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
506
504
}
507
505
508
506
pb -> pwm = devm_pwm_get (& pdev -> dev , NULL );
509
- if (IS_ERR (pb -> pwm ) && PTR_ERR (pb -> pwm ) != - EPROBE_DEFER && !node ) {
510
- dev_err (& pdev -> dev , "unable to request PWM, trying legacy API\n" );
511
- pb -> legacy = true;
512
- pb -> pwm = pwm_request (data -> pwm_id , "pwm-backlight" );
513
- }
514
-
515
507
if (IS_ERR (pb -> pwm )) {
516
508
ret = PTR_ERR (pb -> pwm );
517
509
if (ret != - EPROBE_DEFER )
@@ -604,8 +596,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
604
596
if (IS_ERR (bl )) {
605
597
dev_err (& pdev -> dev , "failed to register backlight\n" );
606
598
ret = PTR_ERR (bl );
607
- if (pb -> legacy )
608
- pwm_free (pb -> pwm );
609
599
goto err_alloc ;
610
600
}
611
601
@@ -639,8 +629,6 @@ static int pwm_backlight_remove(struct platform_device *pdev)
639
629
640
630
if (pb -> exit )
641
631
pb -> exit (& pdev -> dev );
642
- if (pb -> legacy )
643
- pwm_free (pb -> pwm );
644
632
645
633
return 0 ;
646
634
}
0 commit comments