File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -429,6 +429,14 @@ static const struct iio_info cm32181_info = {
429
429
.attrs = & cm32181_attribute_group ,
430
430
};
431
431
432
+ static void cm32181_unregister_dummy_client (void * data )
433
+ {
434
+ struct i2c_client * client = data ;
435
+
436
+ /* Unregister the dummy client */
437
+ i2c_unregister_device (client );
438
+ }
439
+
432
440
static int cm32181_probe (struct i2c_client * client )
433
441
{
434
442
struct device * dev = & client -> dev ;
@@ -460,6 +468,10 @@ static int cm32181_probe(struct i2c_client *client)
460
468
client = i2c_acpi_new_device (dev , 1 , & board_info );
461
469
if (IS_ERR (client ))
462
470
return PTR_ERR (client );
471
+
472
+ ret = devm_add_action_or_reset (dev , cm32181_unregister_dummy_client , client );
473
+ if (ret )
474
+ return ret ;
463
475
}
464
476
465
477
cm32181 = iio_priv (indio_dev );
You can’t perform that action at this time.
0 commit comments