From ebef71237aab8abbf958039028765949f1c43d5f Mon Sep 17 00:00:00 2001 From: leoliu-oc Date: Tue, 23 Jul 2024 16:48:44 +0800 Subject: [PATCH] pinctrl: zhaoxin: fix issues when builting into module Add missing header file declarations due to changes in code version. And fix other issues that are causing built errors. Signed-off-by: leoliu-oc --- drivers/pinctrl/zhaoxin/pinctrl-zhaoxin.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/pinctrl/zhaoxin/pinctrl-zhaoxin.c b/drivers/pinctrl/zhaoxin/pinctrl-zhaoxin.c index b639f2cd079c5..bfd1bb7f022bd 100644 --- a/drivers/pinctrl/zhaoxin/pinctrl-zhaoxin.c +++ b/drivers/pinctrl/zhaoxin/pinctrl-zhaoxin.c @@ -21,23 +21,11 @@ #include #include #include +#include #include "../core.h" #include "pinctrl-zhaoxin.h" -static int pin_to_hwgpio(struct pinctrl_gpio_range *range, unsigned int pin) -{ - int offset = 0; - - if (range->pins) { - for (offset = 0; offset < range->npins; offset++) - if (pin == range->pins[offset]) - break; - return range->base+offset-range->gc->base; - } else - return pin-range->pin_base+range->base-range->gc->base; -} - static u16 zx_pad_read16(struct zhaoxin_pinctrl *pctrl, u8 index) { outb(index, pctrl->pmio_rx90+pctrl->pmio_base); @@ -498,7 +486,7 @@ static int zhaoxin_gpio_irq_type(struct irq_data *d, unsigned int type) else if (type & IRQ_TYPE_LEVEL_HIGH) value |= TRIGGER_HIGH_LEVEL << (point*4); else - pr_debug(pctrl, "%s wrang type\n", __func__); + pr_debug("%s wrong type\n", __func__); zx_pad_write16(pctrl, index, value);