diff options
| author | 2018-06-18 11:36:14 +0200 | |
|---|---|---|
| committer | 2018-06-28 21:50:58 +0900 | |
| commit | bfb623c5b0935a2e4b5fe86eab79a37a37b67209 (patch) | |
| tree | 01b4db9be0c0973a84c02da03f798ec743325a97 | |
| parent | staging: mt7621-gpio: align indentation for all defines (diff) | |
staging: mt7621-gpio: avoid check for NULL in 'to_mediatek_gpio' calls
Function 'to_mediatek_gpio' cannot return NULL, so this NULL
checkings are pointless.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/mt7621-gpio/gpio-mt7621.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c b/drivers/staging/mt7621-gpio/gpio-mt7621.c index 853817a3cf16..1318003b28d5 100644 --- a/drivers/staging/mt7621-gpio/gpio-mt7621.c +++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c @@ -115,9 +115,6 @@ mediatek_gpio_irq_unmask(struct irq_data *d) unsigned long flags; u32 rise, fall, high, low; - if (!rg) - return; - spin_lock_irqsave(&rg->lock, flags); rise = mtk_gpio_r32(rg, GPIO_REG_REDGE); fall = mtk_gpio_r32(rg, GPIO_REG_FEDGE); @@ -139,9 +136,6 @@ mediatek_gpio_irq_mask(struct irq_data *d) unsigned long flags; u32 rise, fall, high, low; - if (!rg) - return; - spin_lock_irqsave(&rg->lock, flags); rise = mtk_gpio_r32(rg, GPIO_REG_REDGE); fall = mtk_gpio_r32(rg, GPIO_REG_FEDGE); @@ -162,9 +156,6 @@ mediatek_gpio_irq_type(struct irq_data *d, unsigned int type) int pin = d->hwirq; u32 mask = BIT(pin); - if (!rg) - return -1; - if (type == IRQ_TYPE_PROBE) { if ((rg->rising | rg->falling | rg->hlevel | rg->llevel) & mask) |
