@@ -220,7 +220,7 @@ static ssize_t attr_fn_lock_show_cptkbd(struct device *dev,
220
220
struct device_attribute * attr ,
221
221
char * buf )
222
222
{
223
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
223
+ struct hid_device * hdev = to_hid_device ( dev );
224
224
struct lenovo_drvdata_cptkbd * cptkbd_data = hid_get_drvdata (hdev );
225
225
226
226
return snprintf (buf , PAGE_SIZE , "%u\n" , cptkbd_data -> fn_lock );
@@ -231,7 +231,7 @@ static ssize_t attr_fn_lock_store_cptkbd(struct device *dev,
231
231
const char * buf ,
232
232
size_t count )
233
233
{
234
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
234
+ struct hid_device * hdev = to_hid_device ( dev );
235
235
struct lenovo_drvdata_cptkbd * cptkbd_data = hid_get_drvdata (hdev );
236
236
int value ;
237
237
@@ -250,7 +250,7 @@ static ssize_t attr_sensitivity_show_cptkbd(struct device *dev,
250
250
struct device_attribute * attr ,
251
251
char * buf )
252
252
{
253
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
253
+ struct hid_device * hdev = to_hid_device ( dev );
254
254
struct lenovo_drvdata_cptkbd * cptkbd_data = hid_get_drvdata (hdev );
255
255
256
256
return snprintf (buf , PAGE_SIZE , "%u\n" ,
@@ -262,7 +262,7 @@ static ssize_t attr_sensitivity_store_cptkbd(struct device *dev,
262
262
const char * buf ,
263
263
size_t count )
264
264
{
265
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
265
+ struct hid_device * hdev = to_hid_device ( dev );
266
266
struct lenovo_drvdata_cptkbd * cptkbd_data = hid_get_drvdata (hdev );
267
267
int value ;
268
268
@@ -387,7 +387,7 @@ static ssize_t attr_press_to_select_show_tpkbd(struct device *dev,
387
387
struct device_attribute * attr ,
388
388
char * buf )
389
389
{
390
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
390
+ struct hid_device * hdev = to_hid_device ( dev );
391
391
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
392
392
393
393
return snprintf (buf , PAGE_SIZE , "%u\n" , data_pointer -> press_to_select );
@@ -398,7 +398,7 @@ static ssize_t attr_press_to_select_store_tpkbd(struct device *dev,
398
398
const char * buf ,
399
399
size_t count )
400
400
{
401
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
401
+ struct hid_device * hdev = to_hid_device ( dev );
402
402
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
403
403
int value ;
404
404
@@ -417,7 +417,7 @@ static ssize_t attr_dragging_show_tpkbd(struct device *dev,
417
417
struct device_attribute * attr ,
418
418
char * buf )
419
419
{
420
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
420
+ struct hid_device * hdev = to_hid_device ( dev );
421
421
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
422
422
423
423
return snprintf (buf , PAGE_SIZE , "%u\n" , data_pointer -> dragging );
@@ -428,7 +428,7 @@ static ssize_t attr_dragging_store_tpkbd(struct device *dev,
428
428
const char * buf ,
429
429
size_t count )
430
430
{
431
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
431
+ struct hid_device * hdev = to_hid_device ( dev );
432
432
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
433
433
int value ;
434
434
@@ -447,7 +447,7 @@ static ssize_t attr_release_to_select_show_tpkbd(struct device *dev,
447
447
struct device_attribute * attr ,
448
448
char * buf )
449
449
{
450
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
450
+ struct hid_device * hdev = to_hid_device ( dev );
451
451
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
452
452
453
453
return snprintf (buf , PAGE_SIZE , "%u\n" , data_pointer -> release_to_select );
@@ -458,7 +458,7 @@ static ssize_t attr_release_to_select_store_tpkbd(struct device *dev,
458
458
const char * buf ,
459
459
size_t count )
460
460
{
461
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
461
+ struct hid_device * hdev = to_hid_device ( dev );
462
462
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
463
463
int value ;
464
464
@@ -477,7 +477,7 @@ static ssize_t attr_select_right_show_tpkbd(struct device *dev,
477
477
struct device_attribute * attr ,
478
478
char * buf )
479
479
{
480
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
480
+ struct hid_device * hdev = to_hid_device ( dev );
481
481
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
482
482
483
483
return snprintf (buf , PAGE_SIZE , "%u\n" , data_pointer -> select_right );
@@ -488,7 +488,7 @@ static ssize_t attr_select_right_store_tpkbd(struct device *dev,
488
488
const char * buf ,
489
489
size_t count )
490
490
{
491
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
491
+ struct hid_device * hdev = to_hid_device ( dev );
492
492
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
493
493
int value ;
494
494
@@ -507,7 +507,7 @@ static ssize_t attr_sensitivity_show_tpkbd(struct device *dev,
507
507
struct device_attribute * attr ,
508
508
char * buf )
509
509
{
510
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
510
+ struct hid_device * hdev = to_hid_device ( dev );
511
511
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
512
512
513
513
return snprintf (buf , PAGE_SIZE , "%u\n" ,
@@ -519,7 +519,7 @@ static ssize_t attr_sensitivity_store_tpkbd(struct device *dev,
519
519
const char * buf ,
520
520
size_t count )
521
521
{
522
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
522
+ struct hid_device * hdev = to_hid_device ( dev );
523
523
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
524
524
int value ;
525
525
@@ -536,7 +536,7 @@ static ssize_t attr_press_speed_show_tpkbd(struct device *dev,
536
536
struct device_attribute * attr ,
537
537
char * buf )
538
538
{
539
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
539
+ struct hid_device * hdev = to_hid_device ( dev );
540
540
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
541
541
542
542
return snprintf (buf , PAGE_SIZE , "%u\n" ,
@@ -548,7 +548,7 @@ static ssize_t attr_press_speed_store_tpkbd(struct device *dev,
548
548
const char * buf ,
549
549
size_t count )
550
550
{
551
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
551
+ struct hid_device * hdev = to_hid_device ( dev );
552
552
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
553
553
int value ;
554
554
@@ -609,7 +609,7 @@ static enum led_brightness lenovo_led_brightness_get_tpkbd(
609
609
struct led_classdev * led_cdev )
610
610
{
611
611
struct device * dev = led_cdev -> dev -> parent ;
612
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
612
+ struct hid_device * hdev = to_hid_device ( dev );
613
613
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
614
614
int led_nr = 0 ;
615
615
@@ -625,7 +625,7 @@ static void lenovo_led_brightness_set_tpkbd(struct led_classdev *led_cdev,
625
625
enum led_brightness value )
626
626
{
627
627
struct device * dev = led_cdev -> dev -> parent ;
628
- struct hid_device * hdev = container_of ( dev , struct hid_device , dev );
628
+ struct hid_device * hdev = to_hid_device ( dev );
629
629
struct lenovo_drvdata_tpkbd * data_pointer = hid_get_drvdata (hdev );
630
630
struct hid_report * report ;
631
631
int led_nr = 0 ;
0 commit comments