forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/pinctrl/vt8500/pinctrl-wmt.c
....@@ -1,16 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Pinctrl driver for the Wondermedia SoC's
34 *
45 * Copyright (c) 2013 Tony Prisk <linux@prisktech.co.nz>
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms and conditions of the GNU General Public License,
8
- * version 2, as published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope it will be useful, but WITHOUT
11
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
- * more details.
146 */
157
168 #include <linux/err.h>
....@@ -495,9 +487,9 @@
495487
496488 val = readl_relaxed(data->base + reg_dir);
497489 if (val & BIT(bit))
498
- return GPIOF_DIR_OUT;
499
- else
500
- return GPIOF_DIR_IN;
490
+ return GPIO_LINE_DIRECTION_OUT;
491
+
492
+ return GPIO_LINE_DIRECTION_IN;
501493 }
502494
503495 static int wmt_gpio_get_value(struct gpio_chip *chip, unsigned offset)
....@@ -563,10 +555,8 @@
563555 struct wmt_pinctrl_data *data)
564556 {
565557 int err;
566
- struct resource *res;
567558
568
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
569
- data->base = devm_ioremap_resource(&pdev->dev, res);
559
+ data->base = devm_platform_ioremap_resource(pdev, 0);
570560 if (IS_ERR(data->base))
571561 return PTR_ERR(data->base);
572562