1212#include <linux/module.h>
1313#include <linux/interrupt.h>
1414#include <linux/i2c.h>
15- #include <linux/of .h>
15+ #include <linux/property .h>
1616#include <linux/fb.h>
1717#include <linux/slab.h>
1818#include <linux/backlight.h>
@@ -491,15 +491,13 @@ static int ht16k33_led_probe(struct device *dev, struct led_classdev *led,
491491 unsigned int brightness )
492492{
493493 struct led_init_data init_data = {};
494- struct device_node * node ;
495494 int err ;
496495
497496 /* 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 )
500499 return 0 ;
501500
502- init_data .fwnode = of_fwnode_handle (node );
503501 init_data .devicename = "auxdisplay" ;
504502 init_data .devname_mandatory = true;
505503
@@ -520,7 +518,6 @@ static int ht16k33_keypad_probe(struct i2c_client *client,
520518 struct ht16k33_keypad * keypad )
521519{
522520 struct device * dev = & client -> dev ;
523- struct device_node * node = dev -> of_node ;
524521 u32 rows = HT16K33_MATRIX_KEYPAD_MAX_ROWS ;
525522 u32 cols = HT16K33_MATRIX_KEYPAD_MAX_COLS ;
526523 int err ;
@@ -539,17 +536,17 @@ static int ht16k33_keypad_probe(struct i2c_client *client,
539536 keypad -> dev -> open = ht16k33_keypad_start ;
540537 keypad -> dev -> close = ht16k33_keypad_stop ;
541538
542- if (!of_get_property ( node , "linux,no-autorepeat" , NULL ))
539+ if (!device_property_read_bool ( dev , "linux,no-autorepeat" ))
543540 __set_bit (EV_REP , keypad -> dev -> evbit );
544541
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 );
547544 if (err ) {
548545 dev_err (dev , "key debounce delay not specified\n" );
549546 return err ;
550547 }
551548
552- err = matrix_keypad_parse_of_params (dev , & rows , & cols );
549+ err = matrix_keypad_parse_properties (dev , & rows , & cols );
553550 if (err )
554551 return err ;
555552 if (rows > HT16K33_MATRIX_KEYPAD_MAX_ROWS ||
@@ -634,8 +631,8 @@ static int ht16k33_fbdev_probe(struct device *dev, struct ht16k33_priv *priv,
634631 goto err_fbdev_buffer ;
635632 }
636633
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 );
639636 if (err ) {
640637 dev_err (dev , "refresh rate not specified\n" );
641638 goto err_fbdev_info ;
@@ -741,8 +738,8 @@ static int ht16k33_probe(struct i2c_client *client)
741738 if (err )
742739 return err ;
743740
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 );
746743 if (err ) {
747744 dft_brightness = MAX_BRIGHTNESS ;
748745 } else if (dft_brightness > MAX_BRIGHTNESS ) {
@@ -830,7 +827,7 @@ static struct i2c_driver ht16k33_driver = {
830827 .remove = ht16k33_remove ,
831828 .driver = {
832829 .name = DRIVER_NAME ,
833- .of_match_table = of_match_ptr ( ht16k33_of_match ) ,
830+ .of_match_table = ht16k33_of_match ,
834831 },
835832 .id_table = ht16k33_i2c_match ,
836833};
0 commit comments