diff options
Diffstat (limited to 'drivers/pinctrl/pinctrl-tegra-xusb.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-tegra-xusb.c | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/drivers/pinctrl/pinctrl-tegra-xusb.c b/drivers/pinctrl/pinctrl-tegra-xusb.c index e477280e62..f3a9a0203f 100644 --- a/drivers/pinctrl/pinctrl-tegra-xusb.c +++ b/drivers/pinctrl/pinctrl-tegra-xusb.c @@ -1,20 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2014 Lucas Stach <l.stach@pengutronix.de> * * Partly based on code * Copyright (C) 2014, NVIDIA CORPORATION. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <common.h> @@ -73,7 +62,7 @@ struct tegra_xusb_padctl_lane { }; struct tegra_xusb_padctl { - struct device_d *dev; + struct device *dev; void __iomem *regs; struct reset_control *rst; @@ -279,7 +268,7 @@ static const struct phy_ops sata_phy_ops = { .power_off = sata_phy_power_off, }; -static struct phy *tegra_xusb_padctl_xlate(struct device_d *dev, +static struct phy *tegra_xusb_padctl_xlate(struct device *dev, struct of_phandle_args *args) { struct tegra_xusb_padctl *padctl = dev->priv; @@ -376,7 +365,7 @@ static struct pinctrl_ops pinctrl_tegra_xusb_ops = { .set_state = pinctrl_tegra_xusb_set_state, }; -static int pinctrl_tegra_xusb_probe(struct device_d *dev) +static int pinctrl_tegra_xusb_probe(struct device *dev) { struct resource *iores; struct tegra_xusb_padctl *padctl; @@ -388,7 +377,7 @@ static int pinctrl_tegra_xusb_probe(struct device_d *dev) dev->priv = padctl; padctl->dev = dev; - dev_get_drvdata(dev, (const void **)&padctl->soc); + padctl->soc = device_get_match_data(dev); iores = dev_request_mem_resource(dev, 0); if (IS_ERR(iores)) { @@ -415,7 +404,7 @@ static int pinctrl_tegra_xusb_probe(struct device_d *dev) goto reset; } - phy = phy_create(dev, NULL, &pcie_phy_ops, NULL); + phy = phy_create(dev, NULL, &pcie_phy_ops); if (IS_ERR(phy)) { err = PTR_ERR(phy); goto unregister; @@ -424,7 +413,7 @@ static int pinctrl_tegra_xusb_probe(struct device_d *dev) padctl->phys[TEGRA_XUSB_PADCTL_PCIE] = phy; phy_set_drvdata(phy, padctl); - phy = phy_create(dev, NULL, &sata_phy_ops, NULL); + phy = phy_create(dev, NULL, &sata_phy_ops); if (IS_ERR(phy)) { err = PTR_ERR(phy); goto unregister; @@ -507,15 +496,12 @@ static __maybe_unused struct of_device_id pinctrl_tegra_xusb_dt_ids[] = { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, pinctrl_tegra_xusb_dt_ids); -static struct driver_d pinctrl_tegra_xusb_driver = { +static struct driver pinctrl_tegra_xusb_driver = { .name = "pinctrl-tegra-xusb", .probe = pinctrl_tegra_xusb_probe, .of_compatible = DRV_OF_COMPAT(pinctrl_tegra_xusb_dt_ids), }; -static int pinctrl_tegra_xusb_init(void) -{ - return platform_driver_register(&pinctrl_tegra_xusb_driver); -} -core_initcall(pinctrl_tegra_xusb_init); +core_platform_driver(pinctrl_tegra_xusb_driver); |