Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933271AbcCKAu0 (ORCPT ); Thu, 10 Mar 2016 19:50:26 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:12453 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932893AbcCKAuY (ORCPT ); Thu, 10 Mar 2016 19:50:24 -0500 Reply-To: Subject: Re: [PATCH v5 1/3] gpio: designware: convert device node to fwnode References: <1457077474-124064-1-git-send-email-qiujiang@huawei.com> <1457077474-124064-2-git-send-email-qiujiang@huawei.com> To: Andy Shevchenko , Alan Tull CC: Linus Walleij , Alexandre Courbot , Mika Westerberg , linux-kernel , "linux-gpio@vger.kernel.org" , "linux-acpi@vger.kernel.org" , , , From: Jiang Qiu Message-ID: <56E215C9.8030208@huawei.com> Date: Fri, 11 Mar 2016 08:48:09 +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: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.160.152] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0201.56E2160B.00FC,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: f77887ba74eededfbe9aee81f90f8638 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2244 Lines: 51 在 2016/3/11 4:27, Andy Shevchenko 写道: > On Thu, Mar 10, 2016 at 9:09 PM, Alan Tull wrote: >> On Fri, Mar 4, 2016 at 1:44 AM, qiujiang wrote: >>> This patch converts device node to fwnode in >>> dwapb_port_property for designware gpio driver, >>> so as to provide a unified data structure for DT >>> and ACPI bindings. >>> >>> Acked-by: Andy Shevchenko >>> Signed-off-by: qiujiang >>> @@ -496,18 +492,19 @@ dwapb_gpio_get_pdata_of(struct device *dev) >>> * Only port A can provide interrupts in all configurations of >>> * the IP. >>> */ >>> - if (pp->idx == 0 && >>> - of_property_read_bool(port_np, "interrupt-controller")) { >>> - pp->irq = irq_of_parse_and_map(port_np, 0); >>> + if (dev->of_node && pp->idx == 0 && >>> + of_property_read_bool(to_of_node(fwnode), >>> + "interrupt-controller")) { >> Hi Qiujiang, >> >> Is there a reason to use "of_property_read_bool" here instead of >> "device_property_read_bool" or similar? > Yeah, this patch looks unfinished. > > This should be > if (pp->idx == 0 && fwnode_property_read_bool(fwnode, > "interrupt-controller")) { Yes, agreed, "to_of_node" will never appear in this patch : ) >> Alan >> >>> + pp->irq = irq_of_parse_and_map(to_of_node(fwnode), 0); > But here should be common method called which takes fwnode on input. Agreed. > >>> if (!pp->irq) { >>> dev_warn(dev, "no irq for bank %s\n", >>> - port_np->full_name); >>> + to_of_node(fwnode)->full_name); >>> } >>> } >>> >>> pp->irq_shared = false; >>> pp->gpio_base = -1; >>> - pp->name = port_np->full_name; >>> + pp->name = to_of_node(fwnode)->full_name; > Also those two should be device property source agnostic. That's what > I tried to tell earlier. Agreed. Thanks, Jiang