From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753058AbcDOCaS (ORCPT ); Thu, 14 Apr 2016 22:30:18 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:56368 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751808AbcDOCaP (ORCPT ); Thu, 14 Apr 2016 22:30:15 -0400 Subject: Re: [PATCH v7 2/3] gpio: dwapb: convert device node to fwnode To: qiujiang , , References: <1459926480-32966-1-git-send-email-qiujiang@huawei.com> <1459926480-32966-3-git-send-email-qiujiang@huawei.com> CC: , , , , , , , , From: Kefeng Wang Message-ID: <57105221.2030202@huawei.com> Date: Fri, 15 Apr 2016 10:29:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1459926480-32966-3-git-send-email-qiujiang@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.180] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.57105233.0095,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 94c750257bf129c26b50f6d4ac181952 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/4/6 15:07, qiujiang wrote: > This patch converts device node to fwnode for dwapb driver, so > as to provide a unified fwnode for DT and ACPI bindings. > > Acked-by: Andy Shevchenko > Signed-off-by: qiujiang > --- > drivers/gpio/gpio-dwapb.c | 37 ++++++++++++++++---------------- > drivers/mfd/intel_quark_i2c_gpio.c | 2 +- > include/linux/platform_data/gpio-dwapb.h | 2 +- > 3 files changed, 20 insertions(+), 21 deletions(-) > > diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c > index 91afec8..3c4d8e6 100644 > --- a/drivers/gpio/gpio-dwapb.c > +++ b/drivers/gpio/gpio-dwapb.c > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -290,14 +291,14 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio, > struct dwapb_port_property *pp) > { > struct gpio_chip *gc = &port->gc; > - struct device_node *node = pp->node; > + struct fwnode_handle *fwnode = pp->fwnode; > struct irq_chip_generic *irq_gc = NULL; > unsigned int hwirq, ngpio = gc->ngpio; > struct irq_chip_type *ct; > int err, i; > > - gpio->domain = irq_domain_add_linear(node, ngpio, > - &irq_generic_chip_ops, gpio); > + gpio->domain = irq_domain_create_linear(fwnode, ngpio, > + &irq_generic_chip_ops, gpio); > if (!gpio->domain) > return; > > @@ -414,7 +415,8 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio, > } > > #ifdef CONFIG_OF_GPIO > - port->gc.of_node = pp->node; > + port->gc.of_node = is_of_node(pp->fwnode) ? > + to_of_node(pp->fwnode) : NULL; It is enough to use port->gc.of_node = to_of_node(pp->fwnode);