| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * IIO multiplexer driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2017 Axentia Technologies AB |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Author: Peter Rosin <peda@axentia.se> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 10 | | - * published by the Free Software Foundation. |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | |
|---|
| 13 | 10 | #include <linux/err.h> |
|---|
| .. | .. |
|---|
| 357 | 354 | return -ENODEV; |
|---|
| 358 | 355 | |
|---|
| 359 | 356 | parent = devm_iio_channel_get(dev, "parent"); |
|---|
| 360 | | - if (IS_ERR(parent)) { |
|---|
| 361 | | - if (PTR_ERR(parent) != -EPROBE_DEFER) |
|---|
| 362 | | - dev_err(dev, "failed to get parent channel\n"); |
|---|
| 363 | | - return PTR_ERR(parent); |
|---|
| 364 | | - } |
|---|
| 357 | + if (IS_ERR(parent)) |
|---|
| 358 | + return dev_err_probe(dev, PTR_ERR(parent), |
|---|
| 359 | + "failed to get parent channel\n"); |
|---|
| 365 | 360 | |
|---|
| 366 | 361 | sizeof_ext_info = iio_get_channel_ext_info_count(parent); |
|---|
| 367 | 362 | if (sizeof_ext_info) { |
|---|
| .. | .. |
|---|
| 398 | 393 | mux->cached_state = -1; |
|---|
| 399 | 394 | |
|---|
| 400 | 395 | indio_dev->name = dev_name(dev); |
|---|
| 401 | | - indio_dev->dev.parent = dev; |
|---|
| 402 | 396 | indio_dev->info = &mux_info; |
|---|
| 403 | 397 | indio_dev->modes = INDIO_DIRECT_MODE; |
|---|
| 404 | 398 | indio_dev->channels = mux->chan; |
|---|