File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -296,7 +296,6 @@ static int sc27xx_led_probe(struct platform_device *pdev)
296
296
return - ENOMEM ;
297
297
298
298
platform_set_drvdata (pdev , priv );
299
- mutex_init (& priv -> lock );
300
299
priv -> base = base ;
301
300
priv -> regmap = dev_get_regmap (dev -> parent , NULL );
302
301
if (!priv -> regmap ) {
@@ -309,20 +308,20 @@ static int sc27xx_led_probe(struct platform_device *pdev)
309
308
err = of_property_read_u32 (child , "reg" , & reg );
310
309
if (err ) {
311
310
of_node_put (child );
312
- mutex_destroy (& priv -> lock );
313
311
return err ;
314
312
}
315
313
316
314
if (reg >= SC27XX_LEDS_MAX || priv -> leds [reg ].active ) {
317
315
of_node_put (child );
318
- mutex_destroy (& priv -> lock );
319
316
return - EINVAL ;
320
317
}
321
318
322
319
priv -> leds [reg ].fwnode = of_fwnode_handle (child );
323
320
priv -> leds [reg ].active = true;
324
321
}
325
322
323
+ mutex_init (& priv -> lock );
324
+
326
325
err = sc27xx_led_register (dev , priv );
327
326
if (err )
328
327
mutex_destroy (& priv -> lock );
You can’t perform that action at this time.
0 commit comments