diff options
Diffstat (limited to 'drivers/gpio/gpio-imx.c')
-rw-r--r-- | drivers/gpio/gpio-imx.c | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/drivers/gpio/gpio-imx.c b/drivers/gpio/gpio-imx.c index 2827e11e73..49c5555b98 100644 --- a/drivers/gpio/gpio-imx.c +++ b/drivers/gpio/gpio-imx.c @@ -1,23 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: 2004 Sascha Hauer, Synertronixx GmbH + /* - * arch/arm/mach-imx/gpio.c - * - * author: Sascha Hauer - * Created: april 20th, 2004 - * Copyright: Synertronixx GmbH - * - * Common code for i.MX machines - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that 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. - * + * arch/arm/mach-imx/gpio.c * + * Common code for i.MX machines */ #include <common.h> @@ -130,7 +117,7 @@ static struct gpio_ops imx_gpio_ops = { .get_direction = imx_get_direction, }; -static int imx_gpio_probe(struct device_d *dev) +static int imx_gpio_probe(struct device *dev) { struct resource *iores; struct imx_gpio_chip *imxgpio; @@ -148,7 +135,7 @@ static int imx_gpio_probe(struct device_d *dev) imxgpio->base = IOMEM(iores->start); imxgpio->chip.ops = &imx_gpio_ops; if (dev->id < 0) { - imxgpio->chip.base = of_alias_get_id(dev->device_node, "gpio"); + imxgpio->chip.base = of_alias_get_id(dev->of_node, "gpio"); if (imxgpio->chip.base < 0) return imxgpio->chip.base; imxgpio->chip.base *= 32; @@ -197,6 +184,7 @@ static __maybe_unused struct of_device_id imx_gpio_dt_ids[] = { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, imx_gpio_dt_ids); static struct platform_device_id imx_gpio_ids[] = { { @@ -210,16 +198,11 @@ static struct platform_device_id imx_gpio_ids[] = { }, }; -static struct driver_d imx_gpio_driver = { +static struct driver imx_gpio_driver = { .name = "imx-gpio", .probe = imx_gpio_probe, .of_compatible = DRV_OF_COMPAT(imx_gpio_dt_ids), .id_table = imx_gpio_ids, }; -static int imx_gpio_add(void) -{ - platform_driver_register(&imx_gpio_driver); - return 0; -} -postcore_initcall(imx_gpio_add); +postcore_platform_driver(imx_gpio_driver); |