Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3987938rwb; Mon, 21 Nov 2022 02:14:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf4cfgLX9IWf1J+o7ftXeolM0uKzkcAmchbD4PGARxQIcQgvoaOkLWrZnKsnHHOLMJAGR0zB X-Received: by 2002:a50:fa86:0:b0:469:cb4d:a529 with SMTP id w6-20020a50fa86000000b00469cb4da529mr223797edr.30.1669025649477; Mon, 21 Nov 2022 02:14:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669025649; cv=none; d=google.com; s=arc-20160816; b=AFvtvMcmaIb6Vht+EQc8R7LL61f7Kv+nvL4ZYbRVkoZZmFhNuGOJKhkfgssxjaJlE3 p2ZvfHqhYGbZEP20uMgUtPYIujePE5PzRIuhm4/1sMM0HzdHPML7QAirsn6ygVRRX+h7 xDnEo2TXrTxj1iv1Zv3hdarnlaCgtf/Xz3rdMGjFDPzSbNRuELVkDEQ3EQYS8PkARh7q qub/155HX0eWnYnbVrXr2znhMmwTami0YpAqwhSbQeBBQ5qKhfZAml5Usp5hYFmY7RLo 5YVuG+lkHsoNWcZS6lNJ8tHV1EEy5ajacQuY6Hb/2fEznl31ZmVJt+BvgX6LJA8pAiUs tR8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=jM00bHGEq4lUTMndaSpKqUjIftgA4mFV7kLrQUFkAlI=; b=M8bWYchRoF48eV4aDK2CC0ynjr9XrWPaiZiQ4mrtVzkWoJoauGYHIuE4AAB+NrRDoH dZ2YCh3ZlwnqCXmyw3KNesJxqRRu+wVkLvJWDrD/lClpyCgxEXUVghIdsM2D2JIVdWSv J7wMzi9LoLog4II0+ys7cj5I/VNgZZvTb3WJ6vR+xpwyAudTR9itRQkqdnWLMUQrzcmw b+fxoTI98Qur7mTmQX2U8xOOcfMCv9UEdThrEUoXd7o+BkTtmMptBgw5bdwuvebjscex bgU+kMXORctcZkPS8aLd2GmOyYZo2U24yTojDwxAm7ScyAF30HNQAbhwAtBDp2qU/yo8 Pb8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Ifhul2fx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i15-20020a05640242cf00b00462848f0cdbsi9849220edc.299.2022.11.21.02.13.44; Mon, 21 Nov 2022 02:14:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=Ifhul2fx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230447AbiKUKBg (ORCPT + 91 others); Mon, 21 Nov 2022 05:01:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230404AbiKUKB1 (ORCPT ); Mon, 21 Nov 2022 05:01:27 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87B178CBBC; Mon, 21 Nov 2022 02:01:17 -0800 (PST) Received: from [192.168.0.43] (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3205D74C; Mon, 21 Nov 2022 11:01:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1669024875; bh=p20aRkH5QQq23LNlV1KjWAHVEBFx1a4/5sQGbTBKEdU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Ifhul2fxlyQpHl9xifoFPhYOK/C5zP4wFGXNn3kRbTI8YTBhMCxKOuTugOf7mtfPx 8/blsBQYvY3iuWZ8QAn1zpl53V3bUdzYUDTEyAqsFODEfDPmN1akkVVzHTkKNMrOsb R39bIL6pgjrJQt31et2EY+y6XGRIH2NAv0s47Q6E= Message-ID: Date: Mon, 21 Nov 2022 10:01:12 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v1 1/4] media: ipu3-cio2: Don't dereference fwnode handle Content-Language: en-US To: Andy Shevchenko , =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , Sakari Ailus , Mauro Carvalho Chehab , Hans de Goede , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Daniel Scally , Heikki Krogerus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Yong Zhi , Bingbu Cao , Tianshu Qiu References: <20221118185617.33908-1-andriy.shevchenko@linux.intel.com> From: Dan Scally In-Reply-To: <20221118185617.33908-1-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, sorry for the delay On 18/11/2022 18:56, Andy Shevchenko wrote: > Use acpi_fwnode_handle() instead of dereferencing an fwnode handle directly, > which is a better coding practice. > > Signed-off-by: Andy Shevchenko > --- > drivers/media/pci/intel/ipu3/cio2-bridge.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/pci/intel/ipu3/cio2-bridge.c b/drivers/media/pci/intel/ipu3/cio2-bridge.c > index df6c94da2f6a..18974a72e94a 100644 > --- a/drivers/media/pci/intel/ipu3/cio2-bridge.c > +++ b/drivers/media/pci/intel/ipu3/cio2-bridge.c > @@ -263,7 +263,7 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, > struct cio2_bridge *bridge, > struct pci_dev *cio2) > { > - struct fwnode_handle *fwnode; > + struct fwnode_handle *fwnode, *primary; > struct cio2_sensor *sensor; > struct acpi_device *adev; > acpi_status status; > @@ -322,7 +322,9 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, > } > > sensor->adev = acpi_dev_get(adev); > - adev->fwnode.secondary = fwnode; > + > + primary = acpi_fwnode_handle(adev); > + primary->secondary = fwnode; > > cio2_bridge_instantiate_vcm_i2c_client(sensor); > LGTM: Reviewed-by: Daniel Scally