Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1713057rda; Tue, 24 Oct 2023 00:26:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGo2Dqgrn+5wzcc/Rww5wP8xY7sbUWRNu8IdacxJI8pEJX+iwY72BJI956R4w6oq4/MKIzN X-Received: by 2002:a05:6808:1b06:b0:3a8:6b4d:6b78 with SMTP id bx6-20020a0568081b0600b003a86b4d6b78mr12983480oib.35.1698132367383; Tue, 24 Oct 2023 00:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698132367; cv=none; d=google.com; s=arc-20160816; b=AXegQrniwqbfhfVBwHYhIvEu5GpJseho/iJVIZm5nnvN0s5+E/pbt7dej34F20RIoC R2wVePIlS4EjPqs1ckHl7RceK446Oreg1cqwu6etwS4D5XBQOwRU97K5y4J9GX7Q+6CO ZeJlRIwelon8SyYIkUVLKB0/Fs7El14kwkenrAz4bFfL1eyuZbVakVxOH/emFLVtLCAp SozSYS3YN0dRa3UE7vZadgOHH/2C554bvMAOBZM9bgg2275uo2CN9fdr/jy/UYBCIsFW CuHGwdBfCPTIXza6CPYZMVPQloQWyCksSKBkjx8EsM3fBAwMOjWGkPy9EQPI1YdnLmTD DufA== 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=TxGi11LChOIr2885N+ana7kskih6GkVg73u2Aky/o9Y=; fh=4qI1tNGp8eUGz2Lsvi0/hPQg0fwF7CY6Vcl0DjjQ1bQ=; b=FcBSMw2AwzAPAW2+0jTwI7cokERfZ1IKqArxHo0LiTGDlym3W3PoEduRd7RGBTYkZe y55Swe5U7uZWajq0zYbQVrc0EnTQcMxcbr1hRR+y0syfqwz9fDxdYRMqext+D6O0KHW9 fYNjI0b90L/xh/LGAxlRJSRXsTXkswHBBa6sRFqUVeBh7uQlsDT7PtShjBMSDcK4zgwG OGYlVbclQ0Ciszsqm5v3IgOt9EXSFJVgD7atqARQXHgL2NC+82Xgs9WVG8aqIvLY8+9h XW23U2nGsk2cKEZ0u9yKIYxOleZH9IPzc1T0pu23yJRqLTM+3/JPle+8QVwpJLR+s9C+ 0zog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=hphYbLp1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id y71-20020a638a4a000000b005b8f45e32c8si123147pgd.776.2023.10.24.00.26.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 00:26:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=hphYbLp1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 7DB9980AE548; Tue, 24 Oct 2023 00:26:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232789AbjJXHZt (ORCPT + 99 others); Tue, 24 Oct 2023 03:25:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232396AbjJXHZs (ORCPT ); Tue, 24 Oct 2023 03:25:48 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1302FB7; Tue, 24 Oct 2023 00:25:47 -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 CBF7DB53; Tue, 24 Oct 2023 09:25:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698132334; bh=4n5YPDRKUKpP21ebpJDoR3ei0XoBIXxtELRuhpW0Ly4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hphYbLp1Dl8TW9QvF4/7qRviM6nvZoBlEyPON3PD/gF16WKqlsWNFi4Vxdx9IqAAx xe81B3LKqN2H1uKaKWNwXbFhqMzmtPMAMJ8tkY3um+HufG72w7luR1ChLtKWgLwdMU S6pMzifMDsaw4zBnC+/6wTWjSbZGCC80JCndsjIY= Date: Tue, 24 Oct 2023 09:25:43 +0200 From: Jacopo Mondi To: =?utf-8?B?QW5kcsOp?= Apitzsch Cc: Ricardo Ribalda , Sakari Ailus , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: Re: [PATCH 3/4] media: i2c: imx214: Read orientation and rotation from system firmware Message-ID: References: <20231023-imx214-v1-0-b33f1bbd1fcf@apitzsch.eu> <20231023-imx214-v1-3-b33f1bbd1fcf@apitzsch.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231023-imx214-v1-3-b33f1bbd1fcf@apitzsch.eu> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 24 Oct 2023 00:26:04 -0700 (PDT) Hi Andre' On Mon, Oct 23, 2023 at 11:47:52PM +0200, André Apitzsch wrote: > Obtain rotation and orientation information from system firmware and > register the appropriate controls. > > Signed-off-by: André Apitzsch > --- > drivers/media/i2c/imx214.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c > index 554fc4733128..bef8dc36e2d0 100644 > --- a/drivers/media/i2c/imx214.c > +++ b/drivers/media/i2c/imx214.c > @@ -704,9 +704,14 @@ static int imx214_ctrls_init(struct imx214 *imx214) > .width = 1120, > .height = 1120, > }; > + struct v4l2_fwnode_device_properties props; > struct v4l2_ctrl_handler *ctrl_hdlr; > int ret; > > + ret = v4l2_fwnode_device_parse(imx214->dev, &props); > + if (ret < 0) > + return ret; > + > ctrl_hdlr = &imx214->ctrls; > ret = v4l2_ctrl_handler_init(&imx214->ctrls, 3); > if (ret) > @@ -746,6 +751,8 @@ static int imx214_ctrls_init(struct imx214 *imx214) > V4L2_CID_UNIT_CELL_SIZE, > v4l2_ctrl_ptr_create((void *)&unit_size)); > > + v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx214_ctrl_ops, &props); > + I think it's fine not checking the return value of v4l2_ctrl_new_fwnode_properties() if you inspect ctrl_hdlr->error just after Reviewed-by: Jacopo Mondi Thanks j > ret = ctrl_hdlr->error; > if (ret) { > v4l2_ctrl_handler_free(ctrl_hdlr); > > -- > 2.42.0 >