| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * TWL6030 GPADC module driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 12 | 13 | * Based on twl4030-madc.c |
|---|
| 13 | 14 | * Copyright (C) 2008 Nokia Corporation |
|---|
| 14 | 15 | * Mikko Ylinen <mikko.k.ylinen@nokia.com> |
|---|
| 15 | | - * |
|---|
| 16 | | - * This program is free software; you can redistribute it and/or |
|---|
| 17 | | - * modify it under the terms of the GNU General Public License |
|---|
| 18 | | - * version 2 as published by the Free Software Foundation. |
|---|
| 19 | | - * |
|---|
| 20 | | - * This program is distributed in the hope that it will be useful, but |
|---|
| 21 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 22 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 23 | | - * General Public License for more details. |
|---|
| 24 | | - * |
|---|
| 25 | | - * You should have received a copy of the GNU General Public License |
|---|
| 26 | | - * along with this program; if not, write to the Free Software |
|---|
| 27 | | - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
|---|
| 28 | | - * 02110-1301 USA |
|---|
| 29 | | - * |
|---|
| 30 | 16 | */ |
|---|
| 31 | 17 | #include <linux/interrupt.h> |
|---|
| 32 | 18 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 108 | 94 | * struct twl6030_gpadc_platform_data - platform specific data |
|---|
| 109 | 95 | * @nchannels: number of GPADC channels |
|---|
| 110 | 96 | * @iio_channels: iio channels |
|---|
| 111 | | - * @twl6030_ideal: pointer to calibration parameters |
|---|
| 97 | + * @ideal: pointer to calibration parameters |
|---|
| 112 | 98 | * @start_conversion: pointer to ADC start conversion function |
|---|
| 113 | | - * @channel_to_reg pointer to ADC function to convert channel to |
|---|
| 99 | + * @channel_to_reg: pointer to ADC function to convert channel to |
|---|
| 114 | 100 | * register address for reading conversion result |
|---|
| 115 | 101 | * @calibrate: pointer to calibration function |
|---|
| 116 | 102 | */ |
|---|
| .. | .. |
|---|
| 919 | 905 | } |
|---|
| 920 | 906 | |
|---|
| 921 | 907 | irq = platform_get_irq(pdev, 0); |
|---|
| 922 | | - if (irq < 0) { |
|---|
| 923 | | - dev_err(&pdev->dev, "failed to get irq\n"); |
|---|
| 908 | + if (irq < 0) |
|---|
| 924 | 909 | return irq; |
|---|
| 925 | | - } |
|---|
| 926 | 910 | |
|---|
| 927 | 911 | ret = devm_request_threaded_irq(dev, irq, NULL, |
|---|
| 928 | 912 | twl6030_gpadc_irq_handler, |
|---|
| 929 | 913 | IRQF_ONESHOT, "twl6030_gpadc", indio_dev); |
|---|
| 914 | + if (ret) |
|---|
| 915 | + return ret; |
|---|
| 930 | 916 | |
|---|
| 931 | 917 | ret = twl6030_gpadc_enable_irq(TWL6030_GPADC_RT_SW1_EOC_MASK); |
|---|
| 932 | 918 | if (ret < 0) { |
|---|
| .. | .. |
|---|
| 942 | 928 | } |
|---|
| 943 | 929 | |
|---|
| 944 | 930 | indio_dev->name = DRIVER_NAME; |
|---|
| 945 | | - indio_dev->dev.parent = dev; |
|---|
| 946 | 931 | indio_dev->info = &twl6030_gpadc_iio_info; |
|---|
| 947 | 932 | indio_dev->modes = INDIO_DIRECT_MODE; |
|---|
| 948 | 933 | indio_dev->channels = pdata->iio_channels; |
|---|