@@ -758,8 +758,8 @@ void free_bulk_waiter(struct vchiq_instance *instance)
758
758
759
759
int vchiq_shutdown (struct vchiq_instance * instance )
760
760
{
761
- int status = 0 ;
762
761
struct vchiq_state * state = instance -> state ;
762
+ int ret = 0 ;
763
763
764
764
if (mutex_lock_killable (& state -> mutex ))
765
765
return - EAGAIN ;
@@ -769,12 +769,12 @@ int vchiq_shutdown(struct vchiq_instance *instance)
769
769
770
770
mutex_unlock (& state -> mutex );
771
771
772
- dev_dbg (state -> dev , "core: (%p): returning %d\n" , instance , status );
772
+ dev_dbg (state -> dev , "core: (%p): returning %d\n" , instance , ret );
773
773
774
774
free_bulk_waiter (instance );
775
775
kfree (instance );
776
776
777
- return status ;
777
+ return ret ;
778
778
}
779
779
EXPORT_SYMBOL (vchiq_shutdown );
780
780
@@ -785,26 +785,26 @@ static int vchiq_is_connected(struct vchiq_instance *instance)
785
785
786
786
int vchiq_connect (struct vchiq_instance * instance )
787
787
{
788
- int status ;
789
788
struct vchiq_state * state = instance -> state ;
789
+ int ret ;
790
790
791
791
if (mutex_lock_killable (& state -> mutex )) {
792
792
dev_dbg (state -> dev ,
793
793
"core: call to mutex_lock failed\n" );
794
- status = - EAGAIN ;
794
+ ret = - EAGAIN ;
795
795
goto failed ;
796
796
}
797
- status = vchiq_connect_internal (state , instance );
797
+ ret = vchiq_connect_internal (state , instance );
798
798
799
- if (!status )
799
+ if (!ret )
800
800
instance -> connected = 1 ;
801
801
802
802
mutex_unlock (& state -> mutex );
803
803
804
804
failed :
805
- dev_dbg (state -> dev , "core: (%p): returning %d\n" , instance , status );
805
+ dev_dbg (state -> dev , "core: (%p): returning %d\n" , instance , ret );
806
806
807
- return status ;
807
+ return ret ;
808
808
}
809
809
EXPORT_SYMBOL (vchiq_connect );
810
810
@@ -813,10 +813,9 @@ vchiq_add_service(struct vchiq_instance *instance,
813
813
const struct vchiq_service_params_kernel * params ,
814
814
unsigned int * phandle )
815
815
{
816
- int status ;
817
816
struct vchiq_state * state = instance -> state ;
818
817
struct vchiq_service * service = NULL ;
819
- int srvstate ;
818
+ int srvstate , ret ;
820
819
821
820
* phandle = VCHIQ_SERVICE_HANDLE_INVALID ;
822
821
@@ -828,24 +827,24 @@ vchiq_add_service(struct vchiq_instance *instance,
828
827
829
828
if (service ) {
830
829
* phandle = service -> handle ;
831
- status = 0 ;
830
+ ret = 0 ;
832
831
} else {
833
- status = - EINVAL ;
832
+ ret = - EINVAL ;
834
833
}
835
834
836
- dev_dbg (state -> dev , "core: (%p): returning %d\n" , instance , status );
835
+ dev_dbg (state -> dev , "core: (%p): returning %d\n" , instance , ret );
837
836
838
- return status ;
837
+ return ret ;
839
838
}
840
839
841
840
int
842
841
vchiq_open_service (struct vchiq_instance * instance ,
843
842
const struct vchiq_service_params_kernel * params ,
844
843
unsigned int * phandle )
845
844
{
846
- int status = - EINVAL ;
847
845
struct vchiq_state * state = instance -> state ;
848
846
struct vchiq_service * service = NULL ;
847
+ int ret = - EINVAL ;
849
848
850
849
* phandle = VCHIQ_SERVICE_HANDLE_INVALID ;
851
850
@@ -856,38 +855,38 @@ vchiq_open_service(struct vchiq_instance *instance,
856
855
857
856
if (service ) {
858
857
* phandle = service -> handle ;
859
- status = vchiq_open_service_internal (service , current -> pid );
860
- if (status ) {
858
+ ret = vchiq_open_service_internal (service , current -> pid );
859
+ if (ret ) {
861
860
vchiq_remove_service (instance , service -> handle );
862
861
* phandle = VCHIQ_SERVICE_HANDLE_INVALID ;
863
862
}
864
863
}
865
864
866
865
failed :
867
- dev_dbg (state -> dev , "core: (%p): returning %d\n" , instance , status );
866
+ dev_dbg (state -> dev , "core: (%p): returning %d\n" , instance , ret );
868
867
869
- return status ;
868
+ return ret ;
870
869
}
871
870
EXPORT_SYMBOL (vchiq_open_service );
872
871
873
872
int
874
873
vchiq_bulk_transmit (struct vchiq_instance * instance , unsigned int handle , const void * data ,
875
874
unsigned int size , void * userdata , enum vchiq_bulk_mode mode )
876
875
{
877
- int status ;
876
+ int ret ;
878
877
879
878
while (1 ) {
880
879
switch (mode ) {
881
880
case VCHIQ_BULK_MODE_NOCALLBACK :
882
881
case VCHIQ_BULK_MODE_CALLBACK :
883
- status = vchiq_bulk_transfer (instance , handle ,
884
- (void * )data , NULL ,
885
- size , userdata , mode ,
886
- VCHIQ_BULK_TRANSMIT );
882
+ ret = vchiq_bulk_transfer (instance , handle ,
883
+ (void * )data , NULL ,
884
+ size , userdata , mode ,
885
+ VCHIQ_BULK_TRANSMIT );
887
886
break ;
888
887
case VCHIQ_BULK_MODE_BLOCKING :
889
- status = vchiq_blocking_bulk_transfer (instance , handle , (void * )data , size ,
890
- VCHIQ_BULK_TRANSMIT );
888
+ ret = vchiq_blocking_bulk_transfer (instance , handle , (void * )data , size ,
889
+ VCHIQ_BULK_TRANSMIT );
891
890
break ;
892
891
default :
893
892
return - EINVAL ;
@@ -898,33 +897,33 @@ vchiq_bulk_transmit(struct vchiq_instance *instance, unsigned int handle, const
898
897
* to implement a retry mechanism since this function is
899
898
* supposed to block until queued
900
899
*/
901
- if (status != - EAGAIN )
900
+ if (ret != - EAGAIN )
902
901
break ;
903
902
904
903
msleep (1 );
905
904
}
906
905
907
- return status ;
906
+ return ret ;
908
907
}
909
908
EXPORT_SYMBOL (vchiq_bulk_transmit );
910
909
911
910
int vchiq_bulk_receive (struct vchiq_instance * instance , unsigned int handle ,
912
911
void * data , unsigned int size , void * userdata ,
913
912
enum vchiq_bulk_mode mode )
914
913
{
915
- int status ;
914
+ int ret ;
916
915
917
916
while (1 ) {
918
917
switch (mode ) {
919
918
case VCHIQ_BULK_MODE_NOCALLBACK :
920
919
case VCHIQ_BULK_MODE_CALLBACK :
921
- status = vchiq_bulk_transfer (instance , handle , data , NULL ,
922
- size , userdata ,
923
- mode , VCHIQ_BULK_RECEIVE );
920
+ ret = vchiq_bulk_transfer (instance , handle , data , NULL ,
921
+ size , userdata ,
922
+ mode , VCHIQ_BULK_RECEIVE );
924
923
break ;
925
924
case VCHIQ_BULK_MODE_BLOCKING :
926
- status = vchiq_blocking_bulk_transfer (instance , handle , (void * )data , size ,
927
- VCHIQ_BULK_RECEIVE );
925
+ ret = vchiq_blocking_bulk_transfer (instance , handle , (void * )data , size ,
926
+ VCHIQ_BULK_RECEIVE );
928
927
break ;
929
928
default :
930
929
return - EINVAL ;
@@ -935,13 +934,13 @@ int vchiq_bulk_receive(struct vchiq_instance *instance, unsigned int handle,
935
934
* to implement a retry mechanism since this function is
936
935
* supposed to block until queued
937
936
*/
938
- if (status != - EAGAIN )
937
+ if (ret != - EAGAIN )
939
938
break ;
940
939
941
940
msleep (1 );
942
941
}
943
942
944
- return status ;
943
+ return ret ;
945
944
}
946
945
EXPORT_SYMBOL (vchiq_bulk_receive );
947
946
@@ -950,8 +949,8 @@ vchiq_blocking_bulk_transfer(struct vchiq_instance *instance, unsigned int handl
950
949
unsigned int size , enum vchiq_bulk_dir dir )
951
950
{
952
951
struct vchiq_service * service ;
953
- int status ;
954
952
struct bulk_waiter_node * waiter = NULL , * iter ;
953
+ int ret ;
955
954
956
955
service = find_service_by_handle (instance , handle );
957
956
if (!service )
@@ -991,10 +990,10 @@ vchiq_blocking_bulk_transfer(struct vchiq_instance *instance, unsigned int handl
991
990
return - ENOMEM ;
992
991
}
993
992
994
- status = vchiq_bulk_transfer (instance , handle , data , NULL , size ,
995
- & waiter -> bulk_waiter ,
996
- VCHIQ_BULK_MODE_BLOCKING , dir );
997
- if ((status != - EAGAIN ) || fatal_signal_pending (current ) || !waiter -> bulk_waiter .bulk ) {
993
+ ret = vchiq_bulk_transfer (instance , handle , data , NULL , size ,
994
+ & waiter -> bulk_waiter ,
995
+ VCHIQ_BULK_MODE_BLOCKING , dir );
996
+ if ((ret != - EAGAIN ) || fatal_signal_pending (current ) || !waiter -> bulk_waiter .bulk ) {
998
997
struct vchiq_bulk * bulk = waiter -> bulk_waiter .bulk ;
999
998
1000
999
if (bulk ) {
@@ -1013,7 +1012,7 @@ vchiq_blocking_bulk_transfer(struct vchiq_instance *instance, unsigned int handl
1013
1012
waiter , current -> pid );
1014
1013
}
1015
1014
1016
- return status ;
1015
+ return ret ;
1017
1016
}
1018
1017
1019
1018
static int
@@ -1137,17 +1136,17 @@ service_callback(struct vchiq_instance *instance, enum vchiq_reason reason,
1137
1136
*/
1138
1137
if ((user_service -> message_available_pos -
1139
1138
instance -> completion_remove ) < 0 ) {
1140
- int status ;
1139
+ int ret ;
1141
1140
1142
1141
dev_dbg (instance -> state -> dev ,
1143
1142
"arm: Inserting extra MESSAGE_AVAILABLE\n" );
1144
1143
DEBUG_TRACE (SERVICE_CALLBACK_LINE );
1145
- status = add_completion (instance , reason , NULL , user_service ,
1146
- bulk_userdata );
1147
- if (status ) {
1144
+ ret = add_completion (instance , reason , NULL , user_service ,
1145
+ bulk_userdata );
1146
+ if (ret ) {
1148
1147
DEBUG_TRACE (SERVICE_CALLBACK_LINE );
1149
1148
vchiq_service_put (service );
1150
- return status ;
1149
+ return ret ;
1151
1150
}
1152
1151
}
1153
1152
@@ -1294,8 +1293,6 @@ vchiq_keepalive_thread_func(void *v)
1294
1293
{
1295
1294
struct vchiq_state * state = (struct vchiq_state * )v ;
1296
1295
struct vchiq_arm_state * arm_state = vchiq_platform_get_arm_state (state );
1297
-
1298
- int status ;
1299
1296
struct vchiq_instance * instance ;
1300
1297
unsigned int ka_handle ;
1301
1298
int ret ;
@@ -1313,16 +1310,16 @@ vchiq_keepalive_thread_func(void *v)
1313
1310
goto exit ;
1314
1311
}
1315
1312
1316
- status = vchiq_connect (instance );
1317
- if (status ) {
1318
- dev_err (state -> dev , "suspend: %s: vchiq_connect failed %d\n" , __func__ , status );
1313
+ ret = vchiq_connect (instance );
1314
+ if (ret ) {
1315
+ dev_err (state -> dev , "suspend: %s: vchiq_connect failed %d\n" , __func__ , ret );
1319
1316
goto shutdown ;
1320
1317
}
1321
1318
1322
- status = vchiq_add_service (instance , & params , & ka_handle );
1323
- if (status ) {
1319
+ ret = vchiq_add_service (instance , & params , & ka_handle );
1320
+ if (ret ) {
1324
1321
dev_err (state -> dev , "suspend: %s: vchiq_open_service failed %d\n" ,
1325
- __func__ , status );
1322
+ __func__ , ret );
1326
1323
goto shutdown ;
1327
1324
}
1328
1325
@@ -1348,17 +1345,17 @@ vchiq_keepalive_thread_func(void *v)
1348
1345
*/
1349
1346
while (uc -- ) {
1350
1347
atomic_inc (& arm_state -> ka_use_ack_count );
1351
- status = vchiq_use_service (instance , ka_handle );
1352
- if (status ) {
1348
+ ret = vchiq_use_service (instance , ka_handle );
1349
+ if (ret ) {
1353
1350
dev_err (state -> dev , "suspend: %s: vchiq_use_service error %d\n" ,
1354
- __func__ , status );
1351
+ __func__ , ret );
1355
1352
}
1356
1353
}
1357
1354
while (rc -- ) {
1358
- status = vchiq_release_service (instance , ka_handle );
1359
- if (status ) {
1355
+ ret = vchiq_release_service (instance , ka_handle );
1356
+ if (ret ) {
1360
1357
dev_err (state -> dev , "suspend: %s: vchiq_release_service error %d\n" ,
1361
- __func__ , status );
1358
+ __func__ , ret );
1362
1359
}
1363
1360
}
1364
1361
}
@@ -1408,13 +1405,13 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service,
1408
1405
write_unlock_bh (& arm_state -> susp_res_lock );
1409
1406
1410
1407
if (!ret ) {
1411
- int status = 0 ;
1408
+ int ret = 0 ;
1412
1409
long ack_cnt = atomic_xchg (& arm_state -> ka_use_ack_count , 0 );
1413
1410
1414
- while (ack_cnt && !status ) {
1411
+ while (ack_cnt && !ret ) {
1415
1412
/* Send the use notify to videocore */
1416
- status = vchiq_send_remote_use_active (state );
1417
- if (!status )
1413
+ ret = vchiq_send_remote_use_active (state );
1414
+ if (!ret )
1418
1415
ack_cnt -- ;
1419
1416
else
1420
1417
atomic_add (ack_cnt , & arm_state -> ka_use_ack_count );
@@ -1730,7 +1727,7 @@ static int vchiq_probe(struct platform_device *pdev)
1730
1727
struct device_node * fw_node ;
1731
1728
const struct vchiq_platform_info * info ;
1732
1729
struct vchiq_drv_mgmt * mgmt ;
1733
- int err ;
1730
+ int ret ;
1734
1731
1735
1732
info = of_device_get_match_data (& pdev -> dev );
1736
1733
if (!info )
@@ -1755,8 +1752,8 @@ static int vchiq_probe(struct platform_device *pdev)
1755
1752
mgmt -> info = info ;
1756
1753
platform_set_drvdata (pdev , mgmt );
1757
1754
1758
- err = vchiq_platform_init (pdev , & mgmt -> state );
1759
- if (err )
1755
+ ret = vchiq_platform_init (pdev , & mgmt -> state );
1756
+ if (ret )
1760
1757
goto failed_platform_init ;
1761
1758
1762
1759
vchiq_debugfs_init (& mgmt -> state );
@@ -1768,8 +1765,8 @@ static int vchiq_probe(struct platform_device *pdev)
1768
1765
* Simply exit on error since the function handles cleanup in
1769
1766
* cases of failure.
1770
1767
*/
1771
- err = vchiq_register_chrdev (& pdev -> dev );
1772
- if (err ) {
1768
+ ret = vchiq_register_chrdev (& pdev -> dev );
1769
+ if (ret ) {
1773
1770
dev_err (& pdev -> dev , "arm: Failed to initialize vchiq cdev\n" );
1774
1771
goto error_exit ;
1775
1772
}
@@ -1782,7 +1779,7 @@ static int vchiq_probe(struct platform_device *pdev)
1782
1779
failed_platform_init :
1783
1780
dev_err (& pdev -> dev , "arm: Could not initialize vchiq platform\n" );
1784
1781
error_exit :
1785
- return err ;
1782
+ return ret ;
1786
1783
}
1787
1784
1788
1785
static void vchiq_remove (struct platform_device * pdev )
0 commit comments