Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751658AbdFIHaP (ORCPT ); Fri, 9 Jun 2017 03:30:15 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:36588 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751584AbdFIHaN (ORCPT ); Fri, 9 Jun 2017 03:30:13 -0400 Subject: Re: [PATCH] of: Introduce of_node_get_match_data() helper To: Geert Uytterhoeven , Rob Herring , Frank Rowand References: <1493142007-29347-1-git-send-email-geert+renesas@glider.be> CC: , From: Vladimir Zapolskiy Message-ID: <7ff6bd21-19f0-7e0c-18bf-e835e7d4319e@mentor.com> Date: Fri, 9 Jun 2017 10:30:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.2.0 MIME-Version: 1.0 In-Reply-To: <1493142007-29347-1-git-send-email-geert+renesas@glider.be> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [137.202.0.87] X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1086 Lines: 35 Hello Geert, On 04/25/2017 08:40 PM, Geert Uytterhoeven wrote: > If CONFIG_OF=n, code using > > info = of_match_node(matchs, np)->data; > > fails to compile: > > warning: dereferencing ‘void *’ pointer > error: request for member ‘data’ in something not a structure or union IMHO firstly all the cases like one above must be fixed in place, in parallel do an overall conversion of subcases: - of_id = of_match_node(some_dt_ids, dev->of_node); + of_id = of_match_device(some_dt_ids, dev); > Follow the example set by of_device_get_match_data(), and introduce a > new helper of_node_get_match_data(). This will allow to increase > compile-testing coverage later. Unfortunately the proposed of_node_get_match_data() is not so similar to the of_device_get_match_data(), the latter one has only one input argument in opposite to of_match_device(), which is truly convenient. > Signed-off-by: Geert Uytterhoeven The change itself is good. Reviewed-by: Vladimir Zapolskiy -- With best wishes, Vladimir