@@ -971,10 +971,9 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
971
971
u32 max_fifo_threshold = (vendor -> fifodepth / 2 ) - 1 ;
972
972
973
973
dev = devm_kzalloc (& adev -> dev , sizeof (* dev ), GFP_KERNEL );
974
- if (!dev ) {
975
- ret = - ENOMEM ;
976
- goto err_no_mem ;
977
- }
974
+ if (!dev )
975
+ return - ENOMEM ;
976
+
978
977
dev -> vendor = vendor ;
979
978
dev -> adev = adev ;
980
979
nmk_i2c_of_probe (np , dev );
@@ -995,30 +994,27 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
995
994
996
995
dev -> virtbase = devm_ioremap (& adev -> dev , adev -> res .start ,
997
996
resource_size (& adev -> res ));
998
- if (!dev -> virtbase ) {
999
- ret = - ENOMEM ;
1000
- goto err_no_mem ;
1001
- }
997
+ if (!dev -> virtbase )
998
+ return - ENOMEM ;
1002
999
1003
1000
dev -> irq = adev -> irq [0 ];
1004
1001
ret = devm_request_irq (& adev -> dev , dev -> irq , i2c_irq_handler , 0 ,
1005
1002
DRIVER_NAME , dev );
1006
1003
if (ret ) {
1007
1004
dev_err (& adev -> dev , "cannot claim the irq %d\n" , dev -> irq );
1008
- goto err_no_mem ;
1005
+ return ret ;
1009
1006
}
1010
1007
1011
1008
dev -> clk = devm_clk_get (& adev -> dev , NULL );
1012
1009
if (IS_ERR (dev -> clk )) {
1013
1010
dev_err (& adev -> dev , "could not get i2c clock\n" );
1014
- ret = PTR_ERR (dev -> clk );
1015
- goto err_no_mem ;
1011
+ return PTR_ERR (dev -> clk );
1016
1012
}
1017
1013
1018
1014
ret = clk_prepare_enable (dev -> clk );
1019
1015
if (ret ) {
1020
1016
dev_err (& adev -> dev , "can't prepare_enable clock\n" );
1021
- goto err_no_mem ;
1017
+ return ret ;
1022
1018
}
1023
1019
1024
1020
init_hw (dev );
@@ -1049,7 +1045,6 @@ static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
1049
1045
1050
1046
err_no_adap :
1051
1047
clk_disable_unprepare (dev -> clk );
1052
- err_no_mem :
1053
1048
1054
1049
return ret ;
1055
1050
}
0 commit comments