From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753373AbcCaAzF (ORCPT ); Wed, 30 Mar 2016 20:55:05 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:65056 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750803AbcCaAzC (ORCPT ); Wed, 30 Mar 2016 20:55:02 -0400 Reply-To: Subject: Re: [PATCH v6 1/2] gpio: dwapb: convert device node to fwnode References: <1458959496-57455-1-git-send-email-qiujiang@huawei.com> <1458959496-57455-2-git-send-email-qiujiang@huawei.com> To: Andy Shevchenko , Alan Tull CC: Linus Walleij , Alexandre Courbot , Mika Westerberg , Jamie Iles , linux-kernel , "linux-gpio@vger.kernel.org" , ACPI Devel Maling List , , , , atull From: Jiang Qiu Message-ID: <56FC7491.5050000@huawei.com> Date: Thu, 31 Mar 2016 08:51:29 +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.0A020205.56FC749E.0005,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: d1ec670b3f9a3c44f30ef2995081951d Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2016/3/30 19:38, Andy Shevchenko 写道: > On Tue, Mar 29, 2016 at 7:30 PM, Alan Tull wrote: >> On Fri, Mar 25, 2016 at 9:31 PM, qiujiang wrote: >> >>> - 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 && >>> + fwnode_property_read_bool(fwnode, >>> + "interrupt-controller")) { >>> + pp->irq = irq_of_parse_and_map(to_of_node(fwnode), 0); >>> 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; >>> + if (dev->of_node) >>> + pp->name = to_of_node(fwnode)->full_name; >> >> Hi Jiang, >> >> I tested lightly on a CycloneV and it worked fine (with device tree). >> >> One suggestion for both patches: you could remove name from struct >> dwapb_port_property and get rid of pp->name and nobody would miss it. >> All it is used for is some dev_err's so the device info gets printed >> anyway. For example (if I leave the irq out of the DT) >> >> gpio-dwapb ff708000.gpio: no irq for bank /soc/gpio@ff708000/gpio-controller@0 >> >> is redundant. The only additional info here from the name is the port >> index. That could be added to the messages without having to get the >> name through the two property/of methods. >> > > Good suggestion! That'll make patches and code cleaner. > > Perhaps separate prepended patch? > Hi Alan/Andy, It sounds good, I will follow this suggestion and do a test. But, what's the "separate prepended patch" mean? Thanks, Jiang