Skip to content

Commit

Permalink
pinctrl: tegra: Pass struct tegra_pmx for pin range check
Browse files Browse the repository at this point in the history
Pass the struct tegra_pmx when checking for the pin range in device
tree. This makes the call site a bit easier to read and will help keep
that readability in a subsequent patch.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20200319122737.3063291-7-thierry.reding@gmail.com
Tested-by: Vidya Sagar <vidyas@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Thierry Reding authored and Linus Walleij committed Mar 27, 2020
1 parent 66539e6 commit 6e01e0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/pinctrl/tegra/pinctrl-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,12 +689,12 @@ const struct dev_pm_ops tegra_pinctrl_pm = {
.resume = &tegra_pinctrl_resume
};

static bool gpio_node_has_range(const char *compatible)
static bool tegra_pinctrl_gpio_node_has_range(struct tegra_pmx *pmx)
{
struct device_node *np;
bool has_prop = false;

np = of_find_compatible_node(NULL, NULL, compatible);
np = of_find_compatible_node(NULL, NULL, pmx->soc->gpio_compatible);
if (!np)
return has_prop;

Expand Down Expand Up @@ -794,7 +794,7 @@ int tegra_pinctrl_probe(struct platform_device *pdev,

tegra_pinctrl_clear_parked_bits(pmx);

if (!gpio_node_has_range(pmx->soc->gpio_compatible))
if (!tegra_pinctrl_gpio_node_has_range(pmx))
pinctrl_add_gpio_range(pmx->pctl, &tegra_pinctrl_gpio_range);

platform_set_drvdata(pdev, pmx);
Expand Down

0 comments on commit 6e01e0c

Please sign in to comment.