Skip to content

Commit 357436a

Browse files
committed
Merge tag 'pinctrl-v4.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pincontrol fixes from Linus Walleij: "These are some v4.4 pin control fixes: - Drop a redundant if-clause from Kconfig - Fix a missing of_node_put() memory leak in the Freescale i.MX driver - Fix 64bit compilation of the Qualcomm SSBI driver. - Fix a logic inversion in the Mediatek driver. - Fix a compilation error for the odd one off in the Super-H instance of the SH PFC driver" * tag 'pinctrl-v4.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: sh-pfc: sh7734: Add missing cfg macro parameter to fix build pinctrl: mediatek: Add get_direction support. pinctrl: fix qcom ssbi drivers for 64-bit compilation pinctrl: imx1-core: add missing of_node_put pinctrl: remove redundant if conditional from Kconfig
2 parents 79e63f5 + 48111b7 commit 357436a

File tree

6 files changed

+15
-18
lines changed

6 files changed

+15
-18
lines changed

drivers/pinctrl/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
config PINCTRL
66
bool
77

8-
if PINCTRL
9-
108
menu "Pin controllers"
119
depends on PINCTRL
1210

@@ -274,5 +272,3 @@ config PINCTRL_TB10X
274272
select GPIOLIB
275273

276274
endmenu
277-
278-
endif

drivers/pinctrl/freescale/pinctrl-imx1-core.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,10 @@ static int imx1_pinctrl_parse_functions(struct device_node *np,
538538
func->groups[i] = child->name;
539539
grp = &info->groups[grp_index++];
540540
ret = imx1_pinctrl_parse_groups(child, grp, info, i++);
541-
if (ret == -ENOMEM)
541+
if (ret == -ENOMEM) {
542+
of_node_put(child);
542543
return ret;
544+
}
543545
}
544546

545547
return 0;
@@ -582,8 +584,10 @@ static int imx1_pinctrl_parse_dt(struct platform_device *pdev,
582584

583585
for_each_child_of_node(np, child) {
584586
ret = imx1_pinctrl_parse_functions(child, info, ifunc++);
585-
if (ret == -ENOMEM)
587+
if (ret == -ENOMEM) {
588+
of_node_put(child);
586589
return -ENOMEM;
590+
}
587591
}
588592

589593
return 0;

drivers/pinctrl/mediatek/pinctrl-mtk-common.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ static int mtk_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
747747
reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dir_offset;
748748
bit = BIT(offset & 0xf);
749749
regmap_read(pctl->regmap1, reg_addr, &read_val);
750-
return !!(read_val & bit);
750+
return !(read_val & bit);
751751
}
752752

753753
static int mtk_gpio_get(struct gpio_chip *chip, unsigned offset)
@@ -757,12 +757,8 @@ static int mtk_gpio_get(struct gpio_chip *chip, unsigned offset)
757757
unsigned int read_val = 0;
758758
struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev);
759759

760-
if (mtk_gpio_get_direction(chip, offset))
761-
reg_addr = mtk_get_port(pctl, offset) +
762-
pctl->devdata->dout_offset;
763-
else
764-
reg_addr = mtk_get_port(pctl, offset) +
765-
pctl->devdata->din_offset;
760+
reg_addr = mtk_get_port(pctl, offset) +
761+
pctl->devdata->din_offset;
766762

767763
bit = BIT(offset & 0xf);
768764
regmap_read(pctl->regmap1, reg_addr, &read_val);
@@ -997,6 +993,7 @@ static struct gpio_chip mtk_gpio_chip = {
997993
.owner = THIS_MODULE,
998994
.request = gpiochip_generic_request,
999995
.free = gpiochip_generic_free,
996+
.get_direction = mtk_gpio_get_direction,
1000997
.direction_input = mtk_gpio_direction_input,
1001998
.direction_output = mtk_gpio_direction_output,
1002999
.get = mtk_gpio_get,

drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
672672
return -ENOMEM;
673673

674674
pctrl->dev = &pdev->dev;
675-
pctrl->npins = (unsigned)of_device_get_match_data(&pdev->dev);
675+
pctrl->npins = (unsigned long)of_device_get_match_data(&pdev->dev);
676676

677677
pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL);
678678
if (!pctrl->regmap) {

drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev)
763763
return -ENOMEM;
764764

765765
pctrl->dev = &pdev->dev;
766-
pctrl->npins = (unsigned)of_device_get_match_data(&pdev->dev);
766+
pctrl->npins = (unsigned long)of_device_get_match_data(&pdev->dev);
767767

768768
pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL);
769769
if (!pctrl->regmap) {

drivers/pinctrl/sh-pfc/pfc-sh7734.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
PORT_GP_12(5, fn, sfx)
3232

3333
#undef _GP_DATA
34-
#define _GP_DATA(bank, pin, name, sfx) \
34+
#define _GP_DATA(bank, pin, name, sfx, cfg) \
3535
PINMUX_DATA(name##_DATA, name##_FN, name##_IN, name##_OUT)
3636

37-
#define _GP_INOUTSEL(bank, pin, name, sfx) name##_IN, name##_OUT
38-
#define _GP_INDT(bank, pin, name, sfx) name##_DATA
37+
#define _GP_INOUTSEL(bank, pin, name, sfx, cfg) name##_IN, name##_OUT
38+
#define _GP_INDT(bank, pin, name, sfx, cfg) name##_DATA
3939
#define GP_INOUTSEL(bank) PORT_GP_32_REV(bank, _GP_INOUTSEL, unused)
4040
#define GP_INDT(bank) PORT_GP_32_REV(bank, _GP_INDT, unused)
4141

0 commit comments

Comments
 (0)