Skip to content

Commit 54a3342

Browse files
Fabio EstevamLinus Walleij
authored andcommitted
pinctrl: mxs: Remove undocumented 'fsl,mxs-gpio' property
The 'fsl,mxs-gpio' property is not documented in gpio-mxs.yaml, but the imx23 and imx28 dtsi describe the gpios as: compatible = "fsl,imx28-gpio", "fsl,mxs-gpio"; This gives schema warnings like: imx28-cfa10037.dtb: pinctrl@80018000: gpio@0:compatible: ['fsl,imx28-gpio', 'fsl,mxs-gpio'] is too long from schema $id: http://devicetree.org/schemas/gpio/gpio-mxs.yaml# "fsl,mxs-gpio" is only used inside pinctrl-mxs, but can be removed if the compatible check is done against fsl,imx23-gpio and fsl,imx28-gpio. Introduce is_mxs_gpio() and remove the need for "fsl,mxs-gpio". Tested on a imx28-evk. Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://lore.kernel.org/r/20230928134321.438547-1-festevam@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 2e44555 commit 54a3342

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

drivers/pinctrl/freescale/pinctrl-mxs.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,19 @@ static int mxs_pinctrl_parse_group(struct platform_device *pdev,
395395
return 0;
396396
}
397397

398+
static bool is_mxs_gpio(struct device_node *child)
399+
{
400+
return of_device_is_compatible(child, "fsl,imx23-gpio") ||
401+
of_device_is_compatible(child, "fsl,imx28-gpio");
402+
}
403+
398404
static int mxs_pinctrl_probe_dt(struct platform_device *pdev,
399405
struct mxs_pinctrl_data *d)
400406
{
401407
struct mxs_pinctrl_soc_data *soc = d->soc;
402408
struct device_node *np = pdev->dev.of_node;
403409
struct device_node *child;
404410
struct mxs_function *f;
405-
const char *gpio_compat = "fsl,mxs-gpio";
406411
const char *fn, *fnull = "";
407412
int i = 0, idxf = 0, idxg = 0;
408413
int ret;
@@ -417,7 +422,7 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev,
417422
/* Count total functions and groups */
418423
fn = fnull;
419424
for_each_child_of_node(np, child) {
420-
if (of_device_is_compatible(child, gpio_compat))
425+
if (is_mxs_gpio(child))
421426
continue;
422427
soc->ngroups++;
423428
/* Skip pure pinconf node */
@@ -446,7 +451,7 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev,
446451
fn = fnull;
447452
f = &soc->functions[idxf];
448453
for_each_child_of_node(np, child) {
449-
if (of_device_is_compatible(child, gpio_compat))
454+
if (is_mxs_gpio(child))
450455
continue;
451456
if (of_property_read_u32(child, "reg", &val))
452457
continue;
@@ -486,7 +491,7 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev,
486491
idxf = 0;
487492
fn = fnull;
488493
for_each_child_of_node(np, child) {
489-
if (of_device_is_compatible(child, gpio_compat))
494+
if (is_mxs_gpio(child))
490495
continue;
491496
if (of_property_read_u32(child, "reg", &val)) {
492497
ret = mxs_pinctrl_parse_group(pdev, child,

0 commit comments

Comments
 (0)