@@ -256,7 +256,7 @@ static ssize_t mei_read(struct file *file, char __user *ubuf,
256256 length = min_t (size_t , length , cb -> buf_idx - * offset );
257257
258258 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" );
260260 rets = - EFAULT ;
261261 goto free ;
262262 }
@@ -379,7 +379,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
379379
380380 rets = copy_from_user (cb -> buf .data , ubuf , length );
381381 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" );
383383 rets = - EFAULT ;
384384 mei_io_cb_free (cb );
385385 goto out ;
@@ -421,7 +421,7 @@ static int mei_ioctl_connect_client(struct file *file,
421421 /* find ME client we're trying to connect to */
422422 me_cl = mei_me_cl_by_uuid (dev , in_client_uuid );
423423 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" ,
425425 in_client_uuid );
426426 rets = - ENOTTY ;
427427 goto end ;
@@ -431,24 +431,21 @@ static int mei_ioctl_connect_client(struct file *file,
431431 bool forbidden = dev -> override_fixed_address ?
432432 !dev -> allow_fixed_address : !dev -> hbm_f_fa_supported ;
433433 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" ,
435435 in_client_uuid );
436436 rets = - ENOTTY ;
437437 goto end ;
438438 }
439439 }
440440
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 );
447444
448445 /* prepare the output buffer */
449446 client -> max_msg_length = me_cl -> props .max_msg_length ;
450447 client -> protocol_version = me_cl -> props .protocol_version ;
451- dev_dbg (dev -> dev , "Can connect?\n" );
448+ cl_dbg (dev , cl , "Can connect?\n" );
452449
453450 rets = mei_cl_connect (cl , me_cl , file );
454451
@@ -515,19 +512,19 @@ static int mei_ioctl_connect_vtag(struct file *file,
515512 cl = file -> private_data ;
516513 dev = cl -> dev ;
517514
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 );
519516
520517 switch (cl -> state ) {
521518 case MEI_FILE_DISCONNECTED :
522519 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" );
524521 return - EINVAL ;
525522 }
526523 break ;
527524 case MEI_FILE_INITIALIZING :
528525 /* malicious connect from another thread may push vtag */
529526 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" );
531528 return - EINVAL ;
532529 }
533530
@@ -546,7 +543,7 @@ static int mei_ioctl_connect_vtag(struct file *file,
546543 continue ;
547544
548545 /* 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" );
550547 mei_cl_unlink (cl );
551548 kfree (cl );
552549 file -> private_data = pos ;
@@ -656,7 +653,7 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
656653
657654 dev = cl -> dev ;
658655
659- dev_dbg (dev -> dev , "IOCTL cmd = 0x%x" , cmd );
656+ cl_dbg (dev , cl , "IOCTL cmd = 0x%x" , cmd );
660657
661658 mutex_lock (& dev -> device_lock );
662659 if (dev -> dev_state != MEI_DEV_ENABLED ) {
@@ -666,9 +663,9 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
666663
667664 switch (cmd ) {
668665 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" );
670667 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" );
672669 rets = - EFAULT ;
673670 goto out ;
674671 }
@@ -689,18 +686,18 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
689686
690687 /* if all is ok, copying the data back to user. */
691688 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" );
693690 rets = - EFAULT ;
694691 goto out ;
695692 }
696693
697694 break ;
698695
699696 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" );
701698 if (copy_from_user (& conn_vtag , (char __user * )data ,
702699 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" );
704701 rets = - EFAULT ;
705702 goto out ;
706703 }
@@ -711,13 +708,13 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
711708
712709 rets = mei_vt_support_check (dev , cl_uuid );
713710 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" ,
715712 cl_uuid );
716713 if (rets )
717714 goto out ;
718715
719716 if (!vtag ) {
720- dev_dbg (dev -> dev , "vtag can't be zero\n" );
717+ cl_dbg (dev , cl , "vtag can't be zero\n" );
721718 rets = - EINVAL ;
722719 goto out ;
723720 }
@@ -729,34 +726,34 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
729726 /* if all is ok, copying the data back to user. */
730727 if (copy_to_user ((char __user * )data , & conn_vtag ,
731728 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" );
733730 rets = - EFAULT ;
734731 goto out ;
735732 }
736733
737734 break ;
738735
739736 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" );
741738 if (copy_from_user (& notify_req ,
742739 (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" );
744741 rets = - EFAULT ;
745742 goto out ;
746743 }
747744 rets = mei_ioctl_client_notify_request (file , notify_req );
748745 break ;
749746
750747 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" );
752749 rets = mei_ioctl_client_notify_get (file , & notify_get );
753750 if (rets )
754751 goto out ;
755752
756- dev_dbg (dev -> dev , "copy connect data to user\n" );
753+ cl_dbg (dev , cl , "copy connect data to user\n" );
757754 if (copy_to_user ((char __user * )data ,
758755 & 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" );
760757 rets = - EFAULT ;
761758 goto out ;
762759
0 commit comments