[-next] pinctrl: samsung: fix build error without CONFIG_OF_GPIO
diff mbox series

Message ID 20191212092136.37870-1-chenzhou10@huawei.com
State New
Headers show
Series
  • [-next] pinctrl: samsung: fix build error without CONFIG_OF_GPIO
Related show

Commit Message

Chen Zhou Dec. 12, 2019, 9:21 a.m. UTC
If CONFIG_OF_GPIO is n, build fails:

drivers/pinctrl/samsung/pinctrl-samsung.c: In function samsung_gpiolib_register:
drivers/pinctrl/samsung/pinctrl-samsung.c:969:5: error: struct gpio_chip has no member named of_node
   gc->of_node = bank->of_node;

Use #ifdef to guard this.

Reported-by: Hulk Robot <hulkci@huawei.com>Fixes
Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
---
 drivers/pinctrl/samsung/pinctrl-samsung.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Chen Zhou Dec. 12, 2019, 9:27 a.m. UTC | #1
ignore this patch, i will repost it.

On 2019/12/12 17:21, Chen Zhou wrote:
> If CONFIG_OF_GPIO is n, build fails:
> 
> drivers/pinctrl/samsung/pinctrl-samsung.c: In function samsung_gpiolib_register:
> drivers/pinctrl/samsung/pinctrl-samsung.c:969:5: error: struct gpio_chip has no member named of_node
>    gc->of_node = bank->of_node;
> 
> Use #ifdef to guard this.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>Fixes
> Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
> ---
>  drivers/pinctrl/samsung/pinctrl-samsung.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
> index f26574e..5c29ad8 100644
> --- a/drivers/pinctrl/samsung/pinctrl-samsung.c
> +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
> @@ -966,7 +966,9 @@ static int samsung_gpiolib_register(struct platform_device *pdev,
>  		gc->base = bank->grange.base;
>  		gc->ngpio = bank->nr_pins;
>  		gc->parent = &pdev->dev;
> +#ifdef CONFIG_OF_GPIO
>  		gc->of_node = bank->of_node;
> +#endif
>  		gc->label = bank->name;
>  
>  		ret = devm_gpiochip_add_data(&pdev->dev, gc, bank);
>

Patch
diff mbox series

diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
index f26574e..5c29ad8 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.c
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
@@ -966,7 +966,9 @@  static int samsung_gpiolib_register(struct platform_device *pdev,
 		gc->base = bank->grange.base;
 		gc->ngpio = bank->nr_pins;
 		gc->parent = &pdev->dev;
+#ifdef CONFIG_OF_GPIO
 		gc->of_node = bank->of_node;
+#endif
 		gc->label = bank->name;
 
 		ret = devm_gpiochip_add_data(&pdev->dev, gc, bank);