hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/gpio/gpio-grgpio.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Driver for Aeroflex Gaisler GRGPIO General Purpose I/O cores.
34 *
....@@ -12,11 +13,6 @@
1213 * See "Documentation/devicetree/bindings/gpio/gpio-grgpio.txt" for
1314 * information on open firmware properties.
1415 *
15
- * This program is free software; you can redistribute it and/or modify it
16
- * under the terms of the GNU General Public License as published by the
17
- * Free Software Foundation; either version 2 of the License, or (at your
18
- * option) any later version.
19
- *
2016 * Contributors: Andreas Larsson <andreas@gaisler.com>
2117 */
2218
....@@ -30,7 +26,6 @@
3026 #include <linux/gpio/driver.h>
3127 #include <linux/slab.h>
3228 #include <linux/err.h>
33
-#include <linux/gpio/driver.h>
3429 #include <linux/interrupt.h>
3530 #include <linux/irq.h>
3631 #include <linux/irqdomain.h>
....@@ -336,7 +331,6 @@
336331 void __iomem *regs;
337332 struct gpio_chip *gc;
338333 struct grgpio_priv *priv;
339
- struct resource *res;
340334 int err;
341335 u32 prop;
342336 s32 *irqmap;
....@@ -347,8 +341,7 @@
347341 if (!priv)
348342 return -ENOMEM;
349343
350
- res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
351
- regs = devm_ioremap_resource(&ofdev->dev, res);
344
+ regs = devm_platform_ioremap_resource(ofdev, 0);
352345 if (IS_ERR(regs))
353346 return PTR_ERR(regs);
354347
....@@ -417,8 +410,6 @@
417410 * Continue without irq functionality for that
418411 * gpio line
419412 */
420
- dev_err(priv->dev,
421
- "Failed to get irq for offset %d\n", i);
422413 continue;
423414 }
424415 priv->uirqs[lirq->index].uirq = ret;
....@@ -444,11 +435,8 @@
444435 static int grgpio_remove(struct platform_device *ofdev)
445436 {
446437 struct grgpio_priv *priv = platform_get_drvdata(ofdev);
447
- unsigned long flags;
448438 int i;
449439 int ret = 0;
450
-
451
- spin_lock_irqsave(&priv->gc.bgpio_lock, flags);
452440
453441 if (priv->domain) {
454442 for (i = 0; i < GRGPIO_MAX_NGPIO; i++) {
....@@ -465,8 +453,6 @@
465453 irq_domain_remove(priv->domain);
466454
467455 out:
468
- spin_unlock_irqrestore(&priv->gc.bgpio_lock, flags);
469
-
470456 return ret;
471457 }
472458