Skip to content

Commit

Permalink
pinctrl: tegra: xusb: Silence sparse warnings
Browse files Browse the repository at this point in the history
Commit 53d2a71 ("phy: Add Tegra XUSB pad controller support") added
a new driver for the XUSB pad controller that implements a more flexible
devicetree binding. In order to preserve backwards compatibility the old
driver can be probed if the obsolete bindings are detected.

In order to hide the legacy code, these prototypes were defined in a
header private to the new driver. This has the disadvantage of making
the sparse code checker complain about the missing declarations when
compiling the old driver and suggesting to make the functions static.

Avoid these sparse warnings by adding local prototype declarations into
the compatibility driver.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Thierry Reding authored and Linus Walleij committed Apr 24, 2017
1 parent e41f320 commit 02101cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/pinctrl/tegra/pinctrl-tegra-xusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,10 @@ static const struct of_device_id tegra_xusb_padctl_of_match[] = {
};
MODULE_DEVICE_TABLE(of, tegra_xusb_padctl_of_match);

/* predeclare these in order to silence sparse */
int tegra_xusb_padctl_legacy_probe(struct platform_device *pdev);
int tegra_xusb_padctl_legacy_remove(struct platform_device *pdev);

int tegra_xusb_padctl_legacy_probe(struct platform_device *pdev)
{
struct tegra_xusb_padctl *padctl;
Expand Down

0 comments on commit 02101cb

Please sign in to comment.