Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753155AbcLFLPr (ORCPT ); Tue, 6 Dec 2016 06:15:47 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:44010 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752696AbcLFLPn (ORCPT ); Tue, 6 Dec 2016 06:15:43 -0500 X-AuditID: cbfee61b-f796f6d000004092-2d-58469dd38132 Subject: Re: [PATCH v2] v4l: async: make v4l2 coexist with devicetree nodes in a dt overlay To: Javi Merino , linux-media@vger.kernel.org References: <1480932596-4108-1-git-send-email-javi.merino@kernel.org> Cc: Javier Martinez Canillas , Sakari Ailus , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Mauro Carvalho Chehab From: Sylwester Nawrocki Message-id: <2ac49275-7762-5ceb-21bd-684862379610@samsung.com> Date: Tue, 06 Dec 2016 12:15:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-version: 1.0 In-reply-to: <1480932596-4108-1-git-send-email-javi.merino@kernel.org> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNIsWRmVeSWpSXmKPExsVy+t9jQd0rc90iDBZfZ7KYf+Qcq8W/VXPZ LN68XcNkcXnXHDaLng1bWS2WbfrDZPFpyzcmB3aPTas62TzmnQz02NJ/l93j8ya5AJYoN5uM 1MSU1CKF1Lzk/JTMvHRbpdAQN10LJYW8xNxUW6UIXd+QICWFssScUiDPyAANODgHuAcr6dsl uGUcPtPEVDCRq+LvhpVMDYwbOboYOTgkBEwkprdVdTFyApliEhfurWfrYuTiEBKYxSixrP0J C4TzkFHi37OTLCBVwgKxEs96NjKCNIsIuErcvi8AEhYCMm8tmcoMUs8scIZR4tOPKewgCTYB Q4neo32MIDavgJ3E44ebwGwWAVWJN7dPsIDMERWIkGg4nA5RIijxY/I9sFWcAm4SLVdfgZUw C+hJ3L+oBRJmFpCX2LzmLfMERqAjETpmIVTNQlK1gJF5FaNEakFyQXFSeq5RXmq5XnFibnFp Xrpecn7uJkZwRD2T3sF4eJf7IUYBDkYlHl6PZtcIIdbEsuLK3EOMEhzMSiK8wrPcIoR4UxIr q1KL8uOLSnNSiw8xmgJ9MZFZSjQ5HxjteSXxhibmJubGBhbmlpYmRkrivI2zn4ULCaQnlqRm p6YWpBbB9DFxcEo1MHp93d4hsMlydm3n2anHK1z4nny4lexwx7D2yFK19FWxvyZKzHC3n3nO XJq9NPBc8urL8o+n7+xoiv201/d+kMs1y546iTijqffFIg/oHjeeqqqmteLhj9h5huYXv9s9 iOdkcRBPnPn82+nDPR/0IxtzZgisVDlZ9GyG6obLXyYK5cq9+DhhR5kSS3FGoqEWc1FxIgDr RrpTvgIAAA== X-MTR: 20000000000000000@CPGS Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1264 Lines: 33 (resending, hopefully now it reaches the mailing lists) On 12/05/2016 11:09 AM, Javi Merino wrote: > Each time the overlay is applied, its of_node pointer will be > different. We are not interested in matching the pointer, what we > want to match is that the path is the one we are expecting. Change to > use of_node_cmp() so that we continue matching after the overlay has > been removed and reapplied. > > Signed-off-by: Javi Merino Thanks, there is clearly a bug in current code as it assumed static representation of DT in the kernel. Reviewed-by: Sylwester Nawrocki > --- > drivers/media/v4l2-core/v4l2-async.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c > index 5bada20..d33a17c 100644 > --- a/drivers/media/v4l2-core/v4l2-async.c > +++ b/drivers/media/v4l2-core/v4l2-async.c > @@ -42,7 +42,8 @@ static bool match_devname(struct v4l2_subdev *sd, > > static bool match_of(struct v4l2_subdev *sd, struct v4l2_async_subdev *asd) > { > - return sd->of_node == asd->match.of.node; > + return !of_node_cmp(of_node_full_name(sd->of_node), > + of_node_full_name(asd->match.of.node)); > }