12
12
#include <linux/module.h>
13
13
#include <linux/interrupt.h>
14
14
#include <linux/i2c.h>
15
- #include <linux/of .h>
15
+ #include <linux/property .h>
16
16
#include <linux/fb.h>
17
17
#include <linux/slab.h>
18
18
#include <linux/backlight.h>
@@ -491,15 +491,13 @@ static int ht16k33_led_probe(struct device *dev, struct led_classdev *led,
491
491
unsigned int brightness )
492
492
{
493
493
struct led_init_data init_data = {};
494
- struct device_node * node ;
495
494
int err ;
496
495
497
496
/* The LED is optional */
498
- node = of_get_child_by_name (dev -> of_node , "led" );
499
- if (!node )
497
+ init_data . fwnode = device_get_named_child_node (dev , "led" );
498
+ if (!init_data . fwnode )
500
499
return 0 ;
501
500
502
- init_data .fwnode = of_fwnode_handle (node );
503
501
init_data .devicename = "auxdisplay" ;
504
502
init_data .devname_mandatory = true;
505
503
@@ -520,7 +518,6 @@ static int ht16k33_keypad_probe(struct i2c_client *client,
520
518
struct ht16k33_keypad * keypad )
521
519
{
522
520
struct device * dev = & client -> dev ;
523
- struct device_node * node = dev -> of_node ;
524
521
u32 rows = HT16K33_MATRIX_KEYPAD_MAX_ROWS ;
525
522
u32 cols = HT16K33_MATRIX_KEYPAD_MAX_COLS ;
526
523
int err ;
@@ -539,17 +536,17 @@ static int ht16k33_keypad_probe(struct i2c_client *client,
539
536
keypad -> dev -> open = ht16k33_keypad_start ;
540
537
keypad -> dev -> close = ht16k33_keypad_stop ;
541
538
542
- if (!of_get_property ( node , "linux,no-autorepeat" , NULL ))
539
+ if (!device_property_read_bool ( dev , "linux,no-autorepeat" ))
543
540
__set_bit (EV_REP , keypad -> dev -> evbit );
544
541
545
- err = of_property_read_u32 ( node , "debounce-delay-ms" ,
546
- & keypad -> debounce_ms );
542
+ err = device_property_read_u32 ( dev , "debounce-delay-ms" ,
543
+ & keypad -> debounce_ms );
547
544
if (err ) {
548
545
dev_err (dev , "key debounce delay not specified\n" );
549
546
return err ;
550
547
}
551
548
552
- err = matrix_keypad_parse_of_params (dev , & rows , & cols );
549
+ err = matrix_keypad_parse_properties (dev , & rows , & cols );
553
550
if (err )
554
551
return err ;
555
552
if (rows > HT16K33_MATRIX_KEYPAD_MAX_ROWS ||
@@ -634,8 +631,8 @@ static int ht16k33_fbdev_probe(struct device *dev, struct ht16k33_priv *priv,
634
631
goto err_fbdev_buffer ;
635
632
}
636
633
637
- err = of_property_read_u32 (dev -> of_node , "refresh-rate-hz" ,
638
- & fbdev -> refresh_rate );
634
+ err = device_property_read_u32 (dev , "refresh-rate-hz" ,
635
+ & fbdev -> refresh_rate );
639
636
if (err ) {
640
637
dev_err (dev , "refresh rate not specified\n" );
641
638
goto err_fbdev_info ;
@@ -741,8 +738,8 @@ static int ht16k33_probe(struct i2c_client *client)
741
738
if (err )
742
739
return err ;
743
740
744
- err = of_property_read_u32 (dev -> of_node , "default-brightness-level" ,
745
- & dft_brightness );
741
+ err = device_property_read_u32 (dev , "default-brightness-level" ,
742
+ & dft_brightness );
746
743
if (err ) {
747
744
dft_brightness = MAX_BRIGHTNESS ;
748
745
} else if (dft_brightness > MAX_BRIGHTNESS ) {
@@ -830,7 +827,7 @@ static struct i2c_driver ht16k33_driver = {
830
827
.remove = ht16k33_remove ,
831
828
.driver = {
832
829
.name = DRIVER_NAME ,
833
- .of_match_table = of_match_ptr ( ht16k33_of_match ) ,
830
+ .of_match_table = ht16k33_of_match ,
834
831
},
835
832
.id_table = ht16k33_i2c_match ,
836
833
};
0 commit comments