@@ -256,7 +256,7 @@ static ssize_t mei_read(struct file *file, char __user *ubuf,
256
256
length = min_t (size_t , length , cb -> buf_idx - * offset );
257
257
258
258
if (copy_to_user (ubuf , cb -> buf .data + * offset , length )) {
259
- dev_dbg (dev -> dev , "failed to copy data to userland\n" );
259
+ cl_dbg (dev , cl , "failed to copy data to userland\n" );
260
260
rets = - EFAULT ;
261
261
goto free ;
262
262
}
@@ -379,7 +379,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
379
379
380
380
rets = copy_from_user (cb -> buf .data , ubuf , length );
381
381
if (rets ) {
382
- dev_dbg (dev -> dev , "failed to copy data from userland\n" );
382
+ cl_dbg (dev , cl , "failed to copy data from userland\n" );
383
383
rets = - EFAULT ;
384
384
mei_io_cb_free (cb );
385
385
goto out ;
@@ -421,7 +421,7 @@ static int mei_ioctl_connect_client(struct file *file,
421
421
/* find ME client we're trying to connect to */
422
422
me_cl = mei_me_cl_by_uuid (dev , in_client_uuid );
423
423
if (!me_cl ) {
424
- dev_dbg (dev -> dev , "Cannot connect to FW Client UUID = %pUl\n" ,
424
+ cl_dbg (dev , cl , "Cannot connect to FW Client UUID = %pUl\n" ,
425
425
in_client_uuid );
426
426
rets = - ENOTTY ;
427
427
goto end ;
@@ -431,24 +431,21 @@ static int mei_ioctl_connect_client(struct file *file,
431
431
bool forbidden = dev -> override_fixed_address ?
432
432
!dev -> allow_fixed_address : !dev -> hbm_f_fa_supported ;
433
433
if (forbidden ) {
434
- dev_dbg (dev -> dev , "Connection forbidden to FW Client UUID = %pUl\n" ,
434
+ cl_dbg (dev , cl , "Connection forbidden to FW Client UUID = %pUl\n" ,
435
435
in_client_uuid );
436
436
rets = - ENOTTY ;
437
437
goto end ;
438
438
}
439
439
}
440
440
441
- dev_dbg (dev -> dev , "Connect to FW Client ID = %d\n" ,
442
- me_cl -> client_id );
443
- dev_dbg (dev -> dev , "FW Client - Protocol Version = %d\n" ,
444
- me_cl -> props .protocol_version );
445
- dev_dbg (dev -> dev , "FW Client - Max Msg Len = %d\n" ,
446
- me_cl -> props .max_msg_length );
441
+ cl_dbg (dev , cl , "Connect to FW Client ID = %d\n" , me_cl -> client_id );
442
+ cl_dbg (dev , cl , "FW Client - Protocol Version = %d\n" , me_cl -> props .protocol_version );
443
+ cl_dbg (dev , cl , "FW Client - Max Msg Len = %d\n" , me_cl -> props .max_msg_length );
447
444
448
445
/* prepare the output buffer */
449
446
client -> max_msg_length = me_cl -> props .max_msg_length ;
450
447
client -> protocol_version = me_cl -> props .protocol_version ;
451
- dev_dbg (dev -> dev , "Can connect?\n" );
448
+ cl_dbg (dev , cl , "Can connect?\n" );
452
449
453
450
rets = mei_cl_connect (cl , me_cl , file );
454
451
@@ -515,19 +512,19 @@ static int mei_ioctl_connect_vtag(struct file *file,
515
512
cl = file -> private_data ;
516
513
dev = cl -> dev ;
517
514
518
- dev_dbg (dev -> dev , "FW Client %pUl vtag %d\n" , in_client_uuid , vtag );
515
+ cl_dbg (dev , cl , "FW Client %pUl vtag %d\n" , in_client_uuid , vtag );
519
516
520
517
switch (cl -> state ) {
521
518
case MEI_FILE_DISCONNECTED :
522
519
if (mei_cl_vtag_by_fp (cl , file ) != vtag ) {
523
- dev_err (dev -> dev , "reconnect with different vtag\n" );
520
+ cl_err (dev , cl , "reconnect with different vtag\n" );
524
521
return - EINVAL ;
525
522
}
526
523
break ;
527
524
case MEI_FILE_INITIALIZING :
528
525
/* malicious connect from another thread may push vtag */
529
526
if (!IS_ERR (mei_cl_fp_by_vtag (cl , vtag ))) {
530
- dev_err (dev -> dev , "vtag already filled\n" );
527
+ cl_err (dev , cl , "vtag already filled\n" );
531
528
return - EINVAL ;
532
529
}
533
530
@@ -546,7 +543,7 @@ static int mei_ioctl_connect_vtag(struct file *file,
546
543
continue ;
547
544
548
545
/* replace cl with acquired one */
549
- dev_dbg (dev -> dev , "replacing with existing cl\n" );
546
+ cl_dbg (dev , cl , "replacing with existing cl\n" );
550
547
mei_cl_unlink (cl );
551
548
kfree (cl );
552
549
file -> private_data = pos ;
@@ -656,7 +653,7 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
656
653
657
654
dev = cl -> dev ;
658
655
659
- dev_dbg (dev -> dev , "IOCTL cmd = 0x%x" , cmd );
656
+ cl_dbg (dev , cl , "IOCTL cmd = 0x%x" , cmd );
660
657
661
658
mutex_lock (& dev -> device_lock );
662
659
if (dev -> dev_state != MEI_DEV_ENABLED ) {
@@ -666,9 +663,9 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
666
663
667
664
switch (cmd ) {
668
665
case IOCTL_MEI_CONNECT_CLIENT :
669
- dev_dbg (dev -> dev , ": IOCTL_MEI_CONNECT_CLIENT. \n" );
666
+ cl_dbg (dev , cl , " IOCTL_MEI_CONNECT_CLIENT\n" );
670
667
if (copy_from_user (& conn , (char __user * )data , sizeof (conn ))) {
671
- dev_dbg (dev -> dev , "failed to copy data from userland\n" );
668
+ cl_dbg (dev , cl , "failed to copy data from userland\n" );
672
669
rets = - EFAULT ;
673
670
goto out ;
674
671
}
@@ -689,18 +686,18 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
689
686
690
687
/* if all is ok, copying the data back to user. */
691
688
if (copy_to_user ((char __user * )data , & conn , sizeof (conn ))) {
692
- dev_dbg (dev -> dev , "failed to copy data to userland\n" );
689
+ cl_dbg (dev , cl , "failed to copy data to userland\n" );
693
690
rets = - EFAULT ;
694
691
goto out ;
695
692
}
696
693
697
694
break ;
698
695
699
696
case IOCTL_MEI_CONNECT_CLIENT_VTAG :
700
- dev_dbg (dev -> dev , "IOCTL_MEI_CONNECT_CLIENT_VTAG\n" );
697
+ cl_dbg (dev , cl , "IOCTL_MEI_CONNECT_CLIENT_VTAG\n" );
701
698
if (copy_from_user (& conn_vtag , (char __user * )data ,
702
699
sizeof (conn_vtag ))) {
703
- dev_dbg (dev -> dev , "failed to copy data from userland\n" );
700
+ cl_dbg (dev , cl , "failed to copy data from userland\n" );
704
701
rets = - EFAULT ;
705
702
goto out ;
706
703
}
@@ -711,13 +708,13 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
711
708
712
709
rets = mei_vt_support_check (dev , cl_uuid );
713
710
if (rets == - EOPNOTSUPP )
714
- dev_dbg (dev -> dev , "FW Client %pUl does not support vtags\n" ,
711
+ cl_dbg (dev , cl , "FW Client %pUl does not support vtags\n" ,
715
712
cl_uuid );
716
713
if (rets )
717
714
goto out ;
718
715
719
716
if (!vtag ) {
720
- dev_dbg (dev -> dev , "vtag can't be zero\n" );
717
+ cl_dbg (dev , cl , "vtag can't be zero\n" );
721
718
rets = - EINVAL ;
722
719
goto out ;
723
720
}
@@ -729,34 +726,34 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
729
726
/* if all is ok, copying the data back to user. */
730
727
if (copy_to_user ((char __user * )data , & conn_vtag ,
731
728
sizeof (conn_vtag ))) {
732
- dev_dbg (dev -> dev , "failed to copy data to userland\n" );
729
+ cl_dbg (dev , cl , "failed to copy data to userland\n" );
733
730
rets = - EFAULT ;
734
731
goto out ;
735
732
}
736
733
737
734
break ;
738
735
739
736
case IOCTL_MEI_NOTIFY_SET :
740
- dev_dbg (dev -> dev , ": IOCTL_MEI_NOTIFY_SET. \n" );
737
+ cl_dbg (dev , cl , " IOCTL_MEI_NOTIFY_SET\n" );
741
738
if (copy_from_user (& notify_req ,
742
739
(char __user * )data , sizeof (notify_req ))) {
743
- dev_dbg (dev -> dev , "failed to copy data from userland\n" );
740
+ cl_dbg (dev , cl , "failed to copy data from userland\n" );
744
741
rets = - EFAULT ;
745
742
goto out ;
746
743
}
747
744
rets = mei_ioctl_client_notify_request (file , notify_req );
748
745
break ;
749
746
750
747
case IOCTL_MEI_NOTIFY_GET :
751
- dev_dbg (dev -> dev , ": IOCTL_MEI_NOTIFY_GET. \n" );
748
+ cl_dbg (dev , cl , " IOCTL_MEI_NOTIFY_GET\n" );
752
749
rets = mei_ioctl_client_notify_get (file , & notify_get );
753
750
if (rets )
754
751
goto out ;
755
752
756
- dev_dbg (dev -> dev , "copy connect data to user\n" );
753
+ cl_dbg (dev , cl , "copy connect data to user\n" );
757
754
if (copy_to_user ((char __user * )data ,
758
755
& notify_get , sizeof (notify_get ))) {
759
- dev_dbg (dev -> dev , "failed to copy data to userland\n" );
756
+ cl_dbg (dev , cl , "failed to copy data to userland\n" );
760
757
rets = - EFAULT ;
761
758
goto out ;
762
759
0 commit comments