diff options
Diffstat (limited to 'drivers/input/serio/apbps2.c')
| -rw-r--r-- | drivers/input/serio/apbps2.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/input/serio/apbps2.c b/drivers/input/serio/apbps2.c index 9c9ce097f8bf..b815337be2f4 100644 --- a/drivers/input/serio/apbps2.c +++ b/drivers/input/serio/apbps2.c @@ -14,11 +14,11 @@ * Contributors: Daniel Hellstrom <daniel@gaisler.com> */ #include <linux/platform_device.h> -#include <linux/of_device.h> #include <linux/module.h> #include <linux/serio.h> #include <linux/errno.h> #include <linux/interrupt.h> +#include <linux/of.h> #include <linux/of_irq.h> #include <linux/device.h> #include <linux/delay.h> @@ -132,7 +132,6 @@ static int apbps2_of_probe(struct platform_device *ofdev) struct apbps2_priv *priv; int irq, err; u32 freq_hz; - struct resource *res; priv = devm_kzalloc(&ofdev->dev, sizeof(*priv), GFP_KERNEL); if (!priv) { @@ -141,8 +140,7 @@ static int apbps2_of_probe(struct platform_device *ofdev) } /* Find Device Address */ - res = platform_get_resource(ofdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(&ofdev->dev, res); + priv->regs = devm_platform_get_and_ioremap_resource(ofdev, 0, NULL); if (IS_ERR(priv->regs)) return PTR_ERR(priv->regs); @@ -167,7 +165,7 @@ static int apbps2_of_probe(struct platform_device *ofdev) /* Set reload register to core freq in kHz/10 */ iowrite32be(freq_hz / 10000, &priv->regs->reload); - priv->io = kzalloc(sizeof(struct serio), GFP_KERNEL); + priv->io = kzalloc(sizeof(*priv->io), GFP_KERNEL); if (!priv->io) return -ENOMEM; @@ -189,13 +187,11 @@ static int apbps2_of_probe(struct platform_device *ofdev) return 0; } -static int apbps2_of_remove(struct platform_device *of_dev) +static void apbps2_of_remove(struct platform_device *of_dev) { struct apbps2_priv *priv = platform_get_drvdata(of_dev); serio_unregister_port(priv->io); - - return 0; } static const struct of_device_id apbps2_of_match[] = { |
