Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755327AbbKRH1a (ORCPT ); Wed, 18 Nov 2015 02:27:30 -0500 Received: from mail-bn1on0114.outbound.protection.outlook.com ([157.56.110.114]:15488 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754621AbbKRH11 (ORCPT ); Wed, 18 Nov 2015 02:27:27 -0500 Authentication-Results: spf=permerror (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=freescale.com; Date: Wed, 18 Nov 2015 15:24:39 +0800 From: Peter Chen To: Saurabh Sengar CC: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= , Greg KH , , Subject: Re: [PATCH v4] usb: chipidea: removing of_find_property Message-ID: <20151118072438.GE4228@shlinux2> References: <1447819812-4543-1-git-send-email-saurabh.truth@gmail.com> <20151118060519.GD4228@shlinux2> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD028;1:bsvA3i3+mSXuyaBoucySJioFChjOnyRiUC7mGTmK4H27l64BkQIXBzLAE/qKNrkPjp+3FMa3dEGsb12aVbCud5k3lDdKkVJSBYy9OMvAwJc3Z+imQ0ACKHUyTYmKPdJkA4zZqp8vf8oifMe4Ds71g0vG5s0qgfQjx1u4a2B49v6p20SXy4mnNtvpRxet3Ztw8/O3Y3JSxMYQCl6NSNJjhKi/IAuiSXPc32fhqMiIH8AQ1HSpFxs/fD1lAr6qMB8ZTDmjN8ruVUdZOX90dvzSF815yd6lMLOSRYy/+mGdz4PKTp0++Y1N1JSfmQM8CGryniZU+8AqQj6QgaeYg6Z290xbVI5QDdWDJtC7A5i3a5+xomg7dFmG3V7mj5uteQ2JwTMObPgaqhmzxweRuTGXR7UfkT+qfhVvKVzd+nUnIGU= X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(1060300003)(2980300002)(448002)(199003)(24454002)(189002)(21840400001)(2950100001)(19580405001)(50466002)(33656002)(33716001)(77096005)(87936001)(19580395003)(50986999)(23726002)(110436001)(76176999)(93886004)(54356999)(85326001)(4290100001)(47776003)(46406003)(575784001)(5007970100001)(83506001)(6806005)(92566002)(106466001)(97756001)(86362001)(606003)(81156007)(104016004)(5001960100002)(97736004)(5001920100001)(110136002)(4001350100001)(5008740100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BN3PR0301MB1219;H:tx30smr01.am.freescale.net;FPR:;SPF:PermError;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0301MB1219;2:oh7/XoWSzMt+Uz2Gr0eThk3mtAbr64inehms4dkFX9cMcRGYBS+SIGFI0QghJEEMd0j1BodbWMEU0VraxvlyiCRV63BjuEuUgNGnI4FZSy2Uo3N1778pJWCAIphlf3NGeK4qrf/V6WDzdq/TRa3rQzy+l6I3rbNj2c0OG9j3Sos=;3:smVCS6p05qdbTrOg/B8Zc5+RqvY4oUlZ/7a83N/njWFhCyMURfgBpBw1NzRSwEVunXgGT4NgJq/pzhRJz+wUidX3471rD2Om4nWEuhM2zqeFmeeaQQg1strA+cMwcHafIY3ISW2itmau/Ud6WZQXavxn1tf+Yiv9oAr8gwoyjecztToGlB2ZvPFpUjyA268PvAtla57h3GVT5sBXVyShT+b6zVODriesU+gBh03jmTo=;25:CaS6xrmKRL9oCuPMfiJoJ6lEpH5TstjN97XYjhSxTifjQ70QgPTVdB1/2d38IGSVZuMpYB+quh5xYdBBLOCMl9u1gZCOP8intjbS2aSH+BQypn7LhcxDikDWmYp39jP3aawgp6Z3rh396IaWik/n3VyWN8hIIS+KjhyduSvGgSWICPpB6KtDQvjT8AuF0bpWU002HK7AKLTIH8xLU9BLgAxbAUCppO9y8jkFjbu2T1l6vLPNXVYuLGkjmIBVN2CT4/QZgQIczxH0l9nEsCFpsQ== X-Microsoft-Antispam: UriScan:;BCL:1;PCL:0;RULEID:;SRVR:BN3PR0301MB1219; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0301MB1219;20:i+bP/9BpPVEiyc9ty6NZklHgs05zYWN96jyRm97DWfgaQ3cNODvN1vj6+612VVfyzL+bmgiF93gpDYQROnRWXE0fOz7z4UL3zbnuWwIWEkYCWUyQP7IlTvB83Zm/GEOtChsTU8tceSuqhOHlmut5O+ltRrv0vznkiKtdS1suUKuhTjcHc8db0ddeEzRy6ysUL7o7HsfR6Au9+cC0+bKkl3qOyRQPIHkwqkh5MkzMPe5KRVKZLE2b0reY3jNUU+bCAuE9fmTLoTyz2BAHUYCkMn8bcfkSBRyXC1G6nWj/t1ryxZZK/et8xutlR41YwozJ++zr5ATaW+IebenSA2r10w3ctBcV9gdzD2ruJaeR61U=;4:B2trE8wGI9F3YjrL2zOsTaelxAQZVCohry9WpIDFYQljYzWK5P54+gYss4j1q9bi5DQJQQAEgBWy4WVBsisTVFdQxJjUYvbnAEN/bFpYsx0THD6DP4gM6Yj37sq14sGBfMJuorhzZJeiK64mwoqPcxlO6DYVBFVSpFeDD89C7JctErd2yD6CF8KujHhQXCrS4OZIoWMqHMItFPjfjMep+5nBDR3VbeCaBQBowoKd9mmB+IuEnHMcyVs7N5iua+veXMo1JTJyX8ZchjS7BE+R/h8vyAejDkjPP8Y6aBenHU47qRu/nXiQQ9tDTrpmJiUxndXALeawPH8N3/tOI0jy7dOXAHuEYwR9RdLxgcxvHLHUhYceUJrcms7l/6FAUOSr X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:1;PCL:0;RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(10201501046)(3002001);SRVR:BN3PR0301MB1219;BC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3jDrEGdwTY0VnlpMGrQB6Hb79KRF7+4cLOKfeTT?= =?us-ascii?Q?13BquW4GgfpH4nXm6VolDjNhIde0d7zBmXt463g6ABXWSNHw5WTDtTGqq7We?= =?us-ascii?Q?aZQfQCgflE8QWVQCVVdXmT4OTr5FCi3D8HdnUbSEP7g5OvMSca/Bnm/ZUcKy?= =?us-ascii?Q?HkpYM7aqSFMPAdvfDujx9ZvbjxGV4TMcNvcd7jg/FzXVGVWXH9WKKXwIwRLF?= =?us-ascii?Q?rOwyTIS32Bbwhhz0bwE5+tYsRWfpTOQGulsQIQIX3FvilNF+/jVcr3DcuWHa?= =?us-ascii?Q?WODS78w/sLkTGTdB4Mae91BgswdwI68wOl3fAvb4IVlNw2bUDyankep9cGOK?= =?us-ascii?Q?rnd2lCjlvlSPMfqv7jGhCPXyXLxHAtEo1/85hgLQY+bx8FD0Ua3Ac0g=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN3PR0301MB1219;5:FoMv2ns0H9ile1+/KCpOFOoI9kEFMbTR2JnayKcY/5PDmj6HJarnlR7phrKqdj+7OeCoVGxJWTw+NlOzJmQGL/qe+geWTpCjatQqrdJiujSmLibbIxxuIg8UQs0CobULD9wornXJaofXtvzram6n3A==;24:oqRdLmKMcuT1zwxEy93qrzcTidRfNbCykPRP+xuJRO0TbHbfzDmIriWa+OkjqdwNCSY1thK00VqgKWz8nq11j+YUcEselBLjWCJCZlWZG40=;20:C4F9pQ1k8kKlFbqVRfLXY0e0Lk0G/NLvgkJFj4wG3yTKm9hSfAoyW2qWLbxTC9zZpUhKQ8ViRgiDi/kkVa3rjA== SpamDiagnosticOutput: 1:5 SpamDiagnosticMetadata: 00000000%2D0000%2D0000%2D0000%2D000000000000 SpamDiagnosticMetadata: 1 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2015 07:27:22.2359 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0301MB1219 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3511 Lines: 82 On Wed, Nov 18, 2015 at 11:48:36AM +0530, Saurabh Sengar wrote: > On 18 November 2015 at 11:35, Peter Chen wrote: > > On Wed, Nov 18, 2015 at 09:40:12AM +0530, Saurabh Sengar wrote: > >> call to of_find_property() before of_property_read_u32() is unnecessary. > >> of_property_read_u32() anyway calls to of_find_property() only. > >> > >> Signed-off-by: Saurabh Sengar > >> --- > >> v4 : removed return type check for optional property 'itc-setting' > >> > >> drivers/usb/chipidea/core.c | 57 +++++++++++++++++---------------------------- > >> 1 file changed, 22 insertions(+), 35 deletions(-) > >> > >> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c > >> index 965d0e2..3d1c3c5 100644 > >> --- a/drivers/usb/chipidea/core.c > >> +++ b/drivers/usb/chipidea/core.c > >> @@ -688,52 +688,39 @@ static int ci_get_platdata(struct device *dev, > >> if (usb_get_maximum_speed(dev) == USB_SPEED_FULL) > >> platdata->flags |= CI_HDRC_FORCE_FULLSPEED; > >> > >> - if (of_find_property(dev->of_node, "phy-clkgate-delay-us", NULL)) > >> - of_property_read_u32(dev->of_node, "phy-clkgate-delay-us", > >> + of_property_read_u32(dev->of_node, "phy-clkgate-delay-us", > >> &platdata->phy_clkgate_delay_us); > >> > >> platdata->itc_setting = 1; > >> - if (of_find_property(dev->of_node, "itc-setting", NULL)) { > >> - ret = of_property_read_u32(dev->of_node, "itc-setting", > >> - &platdata->itc_setting); > >> - if (ret) { > >> - dev_err(dev, > >> - "failed to get itc-setting\n"); > >> - return ret; > >> - } > >> - } > >> > >> - if (of_find_property(dev->of_node, "ahb-burst-config", NULL)) { > >> - ret = of_property_read_u32(dev->of_node, "ahb-burst-config", > >> - &platdata->ahb_burst_config); > >> - if (ret) { > >> - dev_err(dev, > >> - "failed to get ahb-burst-config\n"); > >> - return ret; > >> - } > >> + of_property_read_u32(dev->of_node, "itc-setting", > >> + &platdata->itc_setting); > >> + > >> + ret = of_property_read_u32(dev->of_node, "ahb-burst-config", > >> + &platdata->ahb_burst_config); > >> + if (!ret) { > >> platdata->flags |= CI_HDRC_OVERRIDE_AHB_BURST; > >> + } else if (ret != -EINVAL) { > >> + dev_err(dev, "failed to get ahb-burst-config\n"); > >> + return ret; > >> } > > >Sorry, one more comment, why we don't quit if the 'ret' is other error > >value? > > > > Peter > > We quit if error is anything other then -EINVAL. > In case of -EINVAL, it means we are deliberating ignoring that > property thus left it. > Also the previous functionality was like this when we were using > of_find_property(). > Please let me know if this need to be changed, that we need to return > in all kind of error, I will fix it and send it in patch v5. > I am clear now, I will queue it. -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/