hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
....@@ -1,14 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms and conditions of the GNU General Public License,
6
- * version 2, as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope it will be useful, but WITHOUT
9
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
- * more details.
124 */
135
146 #include <linux/delay.h>
....@@ -131,7 +123,7 @@
131123 unsigned *num_pins)
132124 {
133125 /*
134
- * For the tegra-xusb pad controller groups are synonomous
126
+ * For the tegra-xusb pad controller groups are synonymous
135127 * with lanes/pins and there is always one lane/pin per group.
136128 */
137129 *pins = &pinctrl->desc->pins[group].number;
....@@ -881,7 +873,6 @@
881873 {
882874 struct tegra_xusb_padctl *padctl;
883875 const struct of_device_id *match;
884
- struct resource *res;
885876 struct phy *phy;
886877 int err;
887878
....@@ -893,11 +884,16 @@
893884 mutex_init(&padctl->lock);
894885 padctl->dev = &pdev->dev;
895886
887
+ /*
888
+ * Note that we can't replace this by of_device_get_match_data()
889
+ * because we need the separate matching table for this legacy code on
890
+ * Tegra124. of_device_get_match_data() would attempt to use the table
891
+ * from the updated driver and fail.
892
+ */
896893 match = of_match_node(tegra_xusb_padctl_of_match, pdev->dev.of_node);
897894 padctl->soc = match->data;
898895
899
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
900
- padctl->regs = devm_ioremap_resource(&pdev->dev, res);
896
+ padctl->regs = devm_platform_ioremap_resource(pdev, 0);
901897 if (IS_ERR(padctl->regs))
902898 return PTR_ERR(padctl->regs);
903899