| .. | .. |
|---|
| 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; |
|---|
| .. | .. |
|---|
| 458 | 466 | client = i2c_acpi_new_device(dev, 1, &board_info); |
|---|
| 459 | 467 | if (IS_ERR(client)) |
|---|
| 460 | 468 | return PTR_ERR(client); |
|---|
| 469 | + |
|---|
| 470 | + ret = devm_add_action_or_reset(dev, cm32181_unregister_dummy_client, client); |
|---|
| 471 | + if (ret) |
|---|
| 472 | + return ret; |
|---|
| 461 | 473 | } |
|---|
| 462 | 474 | |
|---|
| 463 | 475 | cm32181 = iio_priv(indio_dev); |
|---|