Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh-pfc: Guard DT parsing with #ifdef CONFIG_OF

Fix a compilation error caused by pinconf_generic_parse_dt_config() not
being defined on !CONFIG_OF platforms by guarding the whole DT node
parsing code with #ifdef CONFIG_OF.

Defining a pinconf_generic_parse_dt_config() on !CONFIG_OF would have
been possible as well, but would have resulted in a larger code size on
!CONFIG_OF platforms (such as arch/sh).

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Laurent Pinchart and committed by
Linus Walleij
3a8d63d4 a5d811bb

+4
+4
drivers/pinctrl/sh-pfc/pinctrl.c
··· 74 74 seq_printf(s, "%s", DRV_NAME); 75 75 } 76 76 77 + #ifdef CONFIG_OF 77 78 static int sh_pfc_map_add_config(struct pinctrl_map *map, 78 79 const char *group_or_pin, 79 80 enum pinctrl_map_type type, ··· 271 270 272 271 return ret; 273 272 } 273 + #endif /* CONFIG_OF */ 274 274 275 275 static const struct pinctrl_ops sh_pfc_pinctrl_ops = { 276 276 .get_groups_count = sh_pfc_get_groups_count, 277 277 .get_group_name = sh_pfc_get_group_name, 278 278 .get_group_pins = sh_pfc_get_group_pins, 279 279 .pin_dbg_show = sh_pfc_pin_dbg_show, 280 + #ifdef CONFIG_OF 280 281 .dt_node_to_map = sh_pfc_dt_node_to_map, 281 282 .dt_free_map = sh_pfc_dt_free_map, 283 + #endif 282 284 }; 283 285 284 286 static int sh_pfc_get_functions_count(struct pinctrl_dev *pctldev)