hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/gpio/gpio-msic.c
....@@ -1,32 +1,19 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Intel Medfield MSIC GPIO driver>
34 * Copyright (c) 2011, Intel Corporation.
45 *
56 * Author: Mathias Nyman <mathias.nyman@linux.intel.com>
67 * Based on intel_pmic_gpio.c
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms and conditions of the GNU General Public License,
10
- * version 2, as published by the Free Software Foundation.
11
- *
12
- * This program is distributed in the hope it will be useful, but WITHOUT
13
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15
- * more details.
16
- *
17
- * You should have received a copy of the GNU General Public License along with
18
- * this program; if not, write to the Free Software Foundation, Inc.,
19
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
20
- *
218 */
229
23
-#include <linux/kernel.h>
24
-#include <linux/slab.h>
25
-#include <linux/interrupt.h>
26
-#include <linux/init.h>
2710 #include <linux/gpio/driver.h>
28
-#include <linux/platform_device.h>
11
+#include <linux/init.h>
12
+#include <linux/interrupt.h>
13
+#include <linux/kernel.h>
2914 #include <linux/mfd/intel_msic.h>
15
+#include <linux/platform_device.h>
16
+#include <linux/slab.h>
3017
3118 /* the offset for the mapping of global gpio pin to irq */
3219 #define MSIC_GPIO_IRQ_OFFSET 0x100
....@@ -237,20 +224,17 @@
237224 struct msic_gpio *mg = irq_data_get_irq_handler_data(data);
238225 struct irq_chip *chip = irq_data_get_irq_chip(data);
239226 struct intel_msic *msic = pdev_to_intel_msic(mg->pdev);
227
+ unsigned long pending;
240228 int i;
241229 int bitnr;
242230 u8 pin;
243
- unsigned long pending = 0;
244231
245232 for (i = 0; i < (mg->chip.ngpio / BITS_PER_BYTE); i++) {
246233 intel_msic_irq_read(msic, INTEL_MSIC_GPIO0LVIRQ + i, &pin);
247234 pending = pin;
248235
249
- if (pending) {
250
- for_each_set_bit(bitnr, &pending, BITS_PER_BYTE)
251
- generic_handle_irq(mg->irq_base +
252
- (i * BITS_PER_BYTE) + bitnr);
253
- }
236
+ for_each_set_bit(bitnr, &pending, BITS_PER_BYTE)
237
+ generic_handle_irq(mg->irq_base + i * BITS_PER_BYTE + bitnr);
254238 }
255239 chip->irq_eoi(data);
256240 }