File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -273,30 +273,39 @@ static int mtk_devapc_probe(struct platform_device *pdev)
273
273
return - EINVAL ;
274
274
275
275
devapc_irq = irq_of_parse_and_map (node , 0 );
276
- if (!devapc_irq )
277
- return - EINVAL ;
276
+ if (!devapc_irq ) {
277
+ ret = - EINVAL ;
278
+ goto err ;
279
+ }
278
280
279
281
ctx -> infra_clk = devm_clk_get_enabled (& pdev -> dev , "devapc-infra-clock" );
280
- if (IS_ERR (ctx -> infra_clk ))
281
- return - EINVAL ;
282
+ if (IS_ERR (ctx -> infra_clk )) {
283
+ ret = - EINVAL ;
284
+ goto err ;
285
+ }
282
286
283
287
ret = devm_request_irq (& pdev -> dev , devapc_irq , devapc_violation_irq ,
284
288
IRQF_TRIGGER_NONE , "devapc" , ctx );
285
289
if (ret )
286
- return ret ;
290
+ goto err ;
287
291
288
292
platform_set_drvdata (pdev , ctx );
289
293
290
294
start_devapc (ctx );
291
295
292
296
return 0 ;
297
+
298
+ err :
299
+ iounmap (ctx -> infra_base );
300
+ return ret ;
293
301
}
294
302
295
303
static void mtk_devapc_remove (struct platform_device * pdev )
296
304
{
297
305
struct mtk_devapc_context * ctx = platform_get_drvdata (pdev );
298
306
299
307
stop_devapc (ctx );
308
+ iounmap (ctx -> infra_base );
300
309
}
301
310
302
311
static struct platform_driver mtk_devapc_driver = {
You can’t perform that action at this time.
0 commit comments