| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Freescale Vybrid vf610 ADC driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2013 Freescale Semiconductor, Inc. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | | - * (at your option) any later version. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | | - * GNU General Public License for more details. |
|---|
| 15 | | - * |
|---|
| 16 | | - * You should have received a copy of the GNU General Public License |
|---|
| 17 | | - * along with this program; if not, write to the Free Software |
|---|
| 18 | | - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 19 | 6 | */ |
|---|
| 20 | 7 | |
|---|
| 21 | 8 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 741 | 728 | { |
|---|
| 742 | 729 | struct vf610_adc *info = iio_priv(indio_dev); |
|---|
| 743 | 730 | unsigned int channel; |
|---|
| 744 | | - int ret; |
|---|
| 745 | 731 | int val; |
|---|
| 746 | | - |
|---|
| 747 | | - ret = iio_triggered_buffer_postenable(indio_dev); |
|---|
| 748 | | - if (ret) |
|---|
| 749 | | - return ret; |
|---|
| 750 | 732 | |
|---|
| 751 | 733 | val = readl(info->regs + VF610_REG_ADC_GC); |
|---|
| 752 | 734 | val |= VF610_ADC_ADCON; |
|---|
| .. | .. |
|---|
| 778 | 760 | |
|---|
| 779 | 761 | writel(hc_cfg, info->regs + VF610_REG_ADC_HC0); |
|---|
| 780 | 762 | |
|---|
| 781 | | - return iio_triggered_buffer_predisable(indio_dev); |
|---|
| 763 | + return 0; |
|---|
| 782 | 764 | } |
|---|
| 783 | 765 | |
|---|
| 784 | 766 | static const struct iio_buffer_setup_ops iio_triggered_buffer_setup_ops = { |
|---|
| .. | .. |
|---|
| 819 | 801 | { |
|---|
| 820 | 802 | struct vf610_adc *info; |
|---|
| 821 | 803 | struct iio_dev *indio_dev; |
|---|
| 822 | | - struct resource *mem; |
|---|
| 823 | 804 | int irq; |
|---|
| 824 | 805 | int ret; |
|---|
| 825 | 806 | |
|---|
| .. | .. |
|---|
| 832 | 813 | info = iio_priv(indio_dev); |
|---|
| 833 | 814 | info->dev = &pdev->dev; |
|---|
| 834 | 815 | |
|---|
| 835 | | - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 836 | | - info->regs = devm_ioremap_resource(&pdev->dev, mem); |
|---|
| 816 | + info->regs = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 837 | 817 | if (IS_ERR(info->regs)) |
|---|
| 838 | 818 | return PTR_ERR(info->regs); |
|---|
| 839 | 819 | |
|---|
| 840 | 820 | irq = platform_get_irq(pdev, 0); |
|---|
| 841 | | - if (irq < 0) { |
|---|
| 842 | | - dev_err(&pdev->dev, "no irq resource?\n"); |
|---|
| 821 | + if (irq < 0) |
|---|
| 843 | 822 | return irq; |
|---|
| 844 | | - } |
|---|
| 845 | 823 | |
|---|
| 846 | 824 | ret = devm_request_irq(info->dev, irq, |
|---|
| 847 | 825 | vf610_adc_isr, 0, |
|---|
| .. | .. |
|---|
| 881 | 859 | init_completion(&info->completion); |
|---|
| 882 | 860 | |
|---|
| 883 | 861 | indio_dev->name = dev_name(&pdev->dev); |
|---|
| 884 | | - indio_dev->dev.parent = &pdev->dev; |
|---|
| 885 | | - indio_dev->dev.of_node = pdev->dev.of_node; |
|---|
| 886 | 862 | indio_dev->info = &vf610_adc_iio_info; |
|---|
| 887 | 863 | indio_dev->modes = INDIO_DIRECT_MODE; |
|---|
| 888 | 864 | indio_dev->channels = vf610_adc_iio_channels; |
|---|