|
@@ -279,16 +279,13 @@ static struct irq_domain_ops gpio_rcar_irq_domain_ops = {
|
|
|
static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p)
|
|
|
{
|
|
|
struct gpio_rcar_config *pdata = p->pdev->dev.platform_data;
|
|
|
-#ifdef CONFIG_OF
|
|
|
struct device_node *np = p->pdev->dev.of_node;
|
|
|
struct of_phandle_args args;
|
|
|
int ret;
|
|
|
-#endif
|
|
|
|
|
|
- if (pdata)
|
|
|
+ if (pdata) {
|
|
|
p->config = *pdata;
|
|
|
-#ifdef CONFIG_OF
|
|
|
- else if (np) {
|
|
|
+ } else if (IS_ENABLED(CONFIG_OF) && np) {
|
|
|
ret = of_parse_phandle_with_args(np, "gpio-ranges",
|
|
|
"#gpio-range-cells", 0, &args);
|
|
|
p->config.number_of_pins = ret == 0 && args.args_count == 3
|
|
@@ -296,7 +293,6 @@ static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p)
|
|
|
: RCAR_MAX_GPIO_PER_BANK;
|
|
|
p->config.gpio_base = -1;
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
if (p->config.number_of_pins == 0 ||
|
|
|
p->config.number_of_pins > RCAR_MAX_GPIO_PER_BANK) {
|