forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/drivers/iio/adc/mxs-lradc-adc.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Freescale MXS LRADC ADC driver
34 *
....@@ -7,16 +8,6 @@
78 * Authors:
89 * Marek Vasut <marex@denx.de>
910 * Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
10
- *
11
- * This program is free software; you can redistribute it and/or modify
12
- * it under the terms of the GNU General Public License as published by
13
- * the Free Software Foundation; either version 2 of the License, or
14
- * (at your option) any later version.
15
- *
16
- * This program is distributed in the hope that it will be useful,
17
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- * GNU General Public License for more details.
2011 */
2112
2213 #include <linux/completion.h>
....@@ -466,6 +457,8 @@
466457
467458 trig = devm_iio_trigger_alloc(&iio->dev, "%s-dev%i", iio->name,
468459 iio->id);
460
+ if (!trig)
461
+ return -ENOMEM;
469462
470463 trig->dev.parent = adc->dev;
471464 iio_trigger_set_drvdata(trig, iio);
....@@ -576,8 +569,6 @@
576569
577570 static const struct iio_buffer_setup_ops mxs_lradc_adc_buffer_ops = {
578571 .preenable = &mxs_lradc_adc_buffer_preenable,
579
- .postenable = &iio_triggered_buffer_postenable,
580
- .predisable = &iio_triggered_buffer_predisable,
581572 .postdisable = &mxs_lradc_adc_buffer_postdisable,
582573 .validate_scan_mask = &mxs_lradc_adc_validate_scan_mask,
583574 };
....@@ -730,7 +721,6 @@
730721 platform_set_drvdata(pdev, iio);
731722
732723 iio->name = pdev->name;
733
- iio->dev.parent = dev;
734724 iio->dev.of_node = dev->parent->of_node;
735725 iio->info = &mxs_lradc_adc_iio_info;
736726 iio->modes = INDIO_DIRECT_MODE;