| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * HiSilicon INNO USB2 PHY Driver. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd. |
|---|
| 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, see <http://www.gnu.org/licenses/>. |
|---|
| 18 | 6 | */ |
|---|
| 19 | 7 | |
|---|
| 20 | 8 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 126 | 114 | struct hisi_inno_phy_priv *priv; |
|---|
| 127 | 115 | struct phy_provider *provider; |
|---|
| 128 | 116 | struct device_node *child; |
|---|
| 129 | | - struct resource *res; |
|---|
| 130 | 117 | int i = 0; |
|---|
| 131 | 118 | int ret; |
|---|
| 132 | 119 | |
|---|
| .. | .. |
|---|
| 134 | 121 | if (!priv) |
|---|
| 135 | 122 | return -ENOMEM; |
|---|
| 136 | 123 | |
|---|
| 137 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 138 | | - priv->mmio = devm_ioremap_resource(dev, res); |
|---|
| 124 | + priv->mmio = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 139 | 125 | if (IS_ERR(priv->mmio)) { |
|---|
| 140 | 126 | ret = PTR_ERR(priv->mmio); |
|---|
| 141 | 127 | return ret; |
|---|
| .. | .. |
|---|
| 167 | 153 | phy_set_drvdata(phy, &priv->ports[i]); |
|---|
| 168 | 154 | i++; |
|---|
| 169 | 155 | |
|---|
| 170 | | - if (i > INNO_PHY_PORT_NUM) { |
|---|
| 156 | + if (i >= INNO_PHY_PORT_NUM) { |
|---|
| 171 | 157 | dev_warn(dev, "Support %d ports in maximum\n", i); |
|---|
| 172 | 158 | break; |
|---|
| 173 | 159 | } |
|---|