| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2016 Broadcom |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License, version 2, as |
|---|
| 6 | | - * published by the Free Software Foundation (the "GPL"). |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is distributed in the hope that it will be useful, but |
|---|
| 9 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 10 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 11 | | - * General Public License version 2 (GPLv2) for more details. |
|---|
| 12 | | - * |
|---|
| 13 | | - * You should have received a copy of the GNU General Public License |
|---|
| 14 | | - * version 2 (GPLv2) along with this source code. |
|---|
| 15 | 4 | */ |
|---|
| 16 | 5 | |
|---|
| 17 | 6 | #include <linux/module.h> |
|---|
| 18 | | -#include <linux/of.h> |
|---|
| 7 | +#include <linux/mod_devicetable.h> |
|---|
| 19 | 8 | #include <linux/io.h> |
|---|
| 20 | 9 | #include <linux/clk.h> |
|---|
| 21 | 10 | #include <linux/mfd/syscon.h> |
|---|
| .. | .. |
|---|
| 319 | 308 | "IntMask set failed. Read will likely fail."); |
|---|
| 320 | 309 | read_len = -EIO; |
|---|
| 321 | 310 | goto adc_err; |
|---|
| 322 | | - }; |
|---|
| 311 | + } |
|---|
| 323 | 312 | } |
|---|
| 324 | 313 | regmap_read(adc_priv->regmap, IPROC_INTERRUPT_MASK, &val_check); |
|---|
| 325 | 314 | |
|---|
| .. | .. |
|---|
| 551 | 540 | } |
|---|
| 552 | 541 | |
|---|
| 553 | 542 | adc_priv->irqno = platform_get_irq(pdev, 0); |
|---|
| 554 | | - if (adc_priv->irqno <= 0) { |
|---|
| 555 | | - dev_err(&pdev->dev, "platform_get_irq failed\n"); |
|---|
| 556 | | - ret = -ENODEV; |
|---|
| 557 | | - return ret; |
|---|
| 558 | | - } |
|---|
| 543 | + if (adc_priv->irqno <= 0) |
|---|
| 544 | + return -ENODEV; |
|---|
| 559 | 545 | |
|---|
| 560 | 546 | ret = regmap_update_bits(adc_priv->regmap, IPROC_REGCTL2, |
|---|
| 561 | 547 | IPROC_ADC_AUXIN_SCAN_ENA, 0); |
|---|
| .. | .. |
|---|
| 587 | 573 | } |
|---|
| 588 | 574 | |
|---|
| 589 | 575 | indio_dev->name = "iproc-static-adc"; |
|---|
| 590 | | - indio_dev->dev.parent = &pdev->dev; |
|---|
| 591 | | - indio_dev->dev.of_node = pdev->dev.of_node; |
|---|
| 592 | 576 | indio_dev->info = &iproc_adc_iio_info; |
|---|
| 593 | 577 | indio_dev->modes = INDIO_DIRECT_MODE; |
|---|
| 594 | 578 | indio_dev->channels = iproc_adc_iio_channels; |
|---|
| .. | .. |
|---|
| 633 | 617 | .remove = iproc_adc_remove, |
|---|
| 634 | 618 | .driver = { |
|---|
| 635 | 619 | .name = "iproc-static-adc", |
|---|
| 636 | | - .of_match_table = of_match_ptr(iproc_adc_of_match), |
|---|
| 620 | + .of_match_table = iproc_adc_of_match, |
|---|
| 637 | 621 | }, |
|---|
| 638 | 622 | }; |
|---|
| 639 | 623 | module_platform_driver(iproc_adc_driver); |
|---|