Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2340309rdb; Tue, 10 Oct 2023 00:22:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLcGdiunC3jwAexfZm00a5CXx2xtNQR2Jh8lYcJlC4JQcfkYgY1upFv/antkGF/ehzIeY3 X-Received: by 2002:a05:6a20:1008:b0:14d:f8a4:d0d1 with SMTP id gs8-20020a056a20100800b0014df8a4d0d1mr13131759pzc.35.1696922523709; Tue, 10 Oct 2023 00:22:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696922523; cv=none; d=google.com; s=arc-20160816; b=in6UmuEdHYi3s0jxQJpj1Xk88zh6gP0s/9kaavyjFgcdOA22ucEad2+O1ga12DWScI xBSiBXkhNG5UauqJoBfhSX1FyC+0pdmkqnjImYYnzscQRK0GaC7QGDfJw35zywbJfPCT 78ycg2OuI8zsbj7kN1msZ0NfsLtVwiYy+u0pNRbo6vvjnRaCvabbpNlpP3QHZ0uMvdrO LFtrbDBvJHzoY9HW4s5G0GojFb2pnaRX7q1SAf2bg8SCqQrJpLwKTIUgZScvoXiPZjNZ 0TC9d8wNJOhU4gMTSPk11o3JCON1t40smwErOQaM6JbylA0olalQUruKczSu5ZqRHc1x yZMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZlTQTykiCwWiED+DEUDaoG7GcmJKxr1m5WvUwNuqisE=; fh=QuQhf2I7CZ8H/QjkD2WW4can3kYx3PO+XRwveL3GdQU=; b=lAtYFLy62sAYjTWhoH+JAvteI7bXWBkWr8MxkZB9xiefrQNNFBWLhnWz3rogVoPcC/ CViCCYC8IfiLM2dR73h0jMk+vvYivHcV1GD3YGFaRVMRkqZQKazTpqAmp6sinBGnLawo cTLAiyt/R+OMySJU9WP9UINo0S1QqtjOjdZDOL5H0f034UibudSPx8YFYOkSQ5IGGfps c5MTV+GRSeHW9gypwlEAmB+WOT8wMpyGkZp71ZGCDhzsjtzXgaG7HWlnKFTVwZazKdw8 kKOddlnd8ngixqLMUDs79dm/adiuU0OmW955Uj64alNDLOkaQ3518+scWCzTfSxS7N8R N2xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=V4G8z3ah; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id c20-20020a056a00249400b00690d457764fsi9572935pfv.42.2023.10.10.00.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 00:22:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=V4G8z3ah; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 6C64F80264AF; Tue, 10 Oct 2023 00:22:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442439AbjJJHVs (ORCPT + 99 others); Tue, 10 Oct 2023 03:21:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442479AbjJJHVp (ORCPT ); Tue, 10 Oct 2023 03:21:45 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE68392; Tue, 10 Oct 2023 00:21:43 -0700 (PDT) Received: from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 596E33D6; Tue, 10 Oct 2023 09:21:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1696922500; bh=1cyXPcG1hvJgf3dDnfetJVDrY9Kmi4/216HZOH9llbQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V4G8z3ahN+sUfwQQnWk54kGwqiF6j48AChfW3Mztl8anv9KIc2XADnSDc19LS0nBk 5yIjz6tc7isOGU3C/6fpksSyZJeYImZtE1tSsQxaTac5aatGiBpa8OOTk48mTFwCj5 B7i4pzemiyq9urppvArbUF7Z2TuIfvtDawN+HL+4= Date: Tue, 10 Oct 2023 09:21:39 +0200 From: Jacopo Mondi To: =?utf-8?Q?Ond=C5=99ej?= Jirman Cc: linux-rockchip@lists.infradead.org, Jacopo Mondi , Nicholas Roth , Sakari Ailus , Mauro Carvalho Chehab , "open list:OMNIVISION OV8858 SENSOR DRIVER" , open list Subject: Re: [PATCH v2] media: i2c: ov8858: Don't set fwnode in the driver Message-ID: References: <20231010070747.1781612-1-megi@xff.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231010070747.1781612-1-megi@xff.cz> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 10 Oct 2023 00:22:01 -0700 (PDT) X-Spam-Level: ** Hello Ondřej On Tue, Oct 10, 2023 at 09:07:44AM +0200, Ondřej Jirman wrote: > From: Ondrej Jirman > > This makes the driver work with the new check in > v4l2_async_register_subdev() that was introduced recently in 6.6-rc1. > Without this change, probe fails with: > > ov8858 1-0036: Detected OV8858 sensor, revision 0xb2 > ov8858 1-0036: sub-device fwnode is an endpoint! > ov8858 1-0036: v4l2 async register subdev failed > ov8858: probe of 1-0036 failed with error -22 > > This also simplifies the driver a bit. > > Signed-off-by: Ondrej Jirman Reviewed-by: Jacopo Mondi Thanks! > --- > v2: > - call fwnode_handle_put earlier to avoid multiple calls to it in > error code paths (suggested by Jacopo Mondi) > > drivers/media/i2c/ov8858.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/media/i2c/ov8858.c b/drivers/media/i2c/ov8858.c > index 3af6125a2eee..4d9fd76e2f60 100644 > --- a/drivers/media/i2c/ov8858.c > +++ b/drivers/media/i2c/ov8858.c > @@ -1850,9 +1850,9 @@ static int ov8858_parse_of(struct ov8858 *ov8858) > } > > ret = v4l2_fwnode_endpoint_parse(endpoint, &vep); > + fwnode_handle_put(endpoint); > if (ret) { > dev_err(dev, "Failed to parse endpoint: %d\n", ret); > - fwnode_handle_put(endpoint); > return ret; > } > > @@ -1864,12 +1864,9 @@ static int ov8858_parse_of(struct ov8858 *ov8858) > default: > dev_err(dev, "Unsupported number of data lanes %u\n", > ov8858->num_lanes); > - fwnode_handle_put(endpoint); > return -EINVAL; > } > > - ov8858->subdev.fwnode = endpoint; > - > return 0; > } > > @@ -1913,7 +1910,7 @@ static int ov8858_probe(struct i2c_client *client) > > ret = ov8858_init_ctrls(ov8858); > if (ret) > - goto err_put_fwnode; > + return ret; > > sd = &ov8858->subdev; > sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; > @@ -1964,8 +1961,6 @@ static int ov8858_probe(struct i2c_client *client) > media_entity_cleanup(&sd->entity); > err_free_handler: > v4l2_ctrl_handler_free(&ov8858->ctrl_handler); > -err_put_fwnode: > - fwnode_handle_put(ov8858->subdev.fwnode); > > return ret; > } > @@ -1978,7 +1973,6 @@ static void ov8858_remove(struct i2c_client *client) > v4l2_async_unregister_subdev(sd); > media_entity_cleanup(&sd->entity); > v4l2_ctrl_handler_free(&ov8858->ctrl_handler); > - fwnode_handle_put(ov8858->subdev.fwnode); > > pm_runtime_disable(&client->dev); > if (!pm_runtime_status_suspended(&client->dev)) > -- > 2.42.0 >