Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5894581iob; Tue, 10 May 2022 06:13:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUN3Ne166Q684vS9XvsRyP9re/+gPxgjDap+uEz2gA7d+ZlrLL9Ymm0o0oCw927Iaos0GQ X-Received: by 2002:a63:2c8a:0:b0:3c5:f760:2e36 with SMTP id s132-20020a632c8a000000b003c5f7602e36mr17031111pgs.372.1652188437247; Tue, 10 May 2022 06:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652188437; cv=none; d=google.com; s=arc-20160816; b=eSZRZ/9nr9g5uyRbIpJfPDgoZNcx7rL4aRDcYQR25HL4wbgV+BeYBFYzzF2PKb2yjJ kJhJYVMi3GsWwWy5O+wvMfL9vrqWBRS5Rq8oWzM6gcc/NSIFWXNzTz0QQAK2hh2ZzGbJ YB4PzgO8Xl/v4iijniR/S0qiSVaPMfdfxIGXF7wsLq1wiA6MGjG22JV5K5xoi3LhIpxL XXfdFSUqSmwNVsYN+QZ5gbPdUKa5jcJAPb475oQPzB+nTzuoD3vooBXC9lBO6pRmmBqq cv6+Lybt8Jd9hBelCGHjE+5sqnEhb7DBABNZrWKw+gLMcoGsWWliIr7e+0AOVtHuMj7T yQ0A== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=4RqP6+5c6Gv3iWmEO/1hn5a36D5C3okPPxSiL6H1qLo=; b=lLMdgwFAww/LhzZE6PKUel3veC9n3PL66y3YwvPK0qSp+mUfQAQUjG1ajpa8diYZ4p /mf+8KjP7inWVcBmnmweLkf02gpJTv8cMEWYAWw6O87U5v5uAvJaReS3DMQz+7O0b3Kq o2BqnC4Q1Y27DAOS2qtDdpSZFjOT6+Hs/iJaPHL1wwK1rGmOmMn4PHEnZE6YcjfABKyN 239jKVFxmgs0BVnMsoQUzr6LFPNnsQ6251k5SvfocmdzFj1pb1jWSJuj0havM7YkEid5 DYrreWylUBrVZW5pDgjZBX6vpwqC9PN/YCc2PPM+M/08UPkVAT1DRpJQdurc3Vq5Ah2G o0MQ== ARC-Authentication-Results: i=1; mx.google.com; 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 r17-20020a170902c7d100b00153b2d16647si2696596pla.591.2022.05.10.06.13.41; Tue, 10 May 2022 06:13:57 -0700 (PDT) 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; 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 S239244AbiEJJvz (ORCPT + 99 others); Tue, 10 May 2022 05:51:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239222AbiEJJvx (ORCPT ); Tue, 10 May 2022 05:51:53 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA25B237B86; Tue, 10 May 2022 02:47:56 -0700 (PDT) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id F02761C0003; Tue, 10 May 2022 09:47:52 +0000 (UTC) Date: Tue, 10 May 2022 11:47:51 +0200 From: Jacopo Mondi To: Quentin Schulz Cc: shawnx.tu@intel.com, mchehab@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Quentin Schulz Subject: Re: [PATCH v3 3/4] media: i2c: ov5675: parse and register V4L2 device tree properties Message-ID: <20220510094751.b6xbevurqhezpsnd@uno.localdomain> References: <20220509143226.531117-1-foss+kernel@0leil.net> <20220509143226.531117-3-foss+kernel@0leil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220509143226.531117-3-foss+kernel@0leil.net> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Quentin, On Mon, May 09, 2022 at 04:32:25PM +0200, Quentin Schulz wrote: > From: Quentin Schulz > > Parse V4L2 device tree properties and register controls for them. > > Signed-off-by: Quentin Schulz > --- > drivers/media/i2c/ov5675.c | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/i2c/ov5675.c b/drivers/media/i2c/ov5675.c > index cee380196774..5544e1ae444e 100644 > --- a/drivers/media/i2c/ov5675.c > +++ b/drivers/media/i2c/ov5675.c > @@ -779,12 +779,14 @@ static const struct v4l2_ctrl_ops ov5675_ctrl_ops = { > > static int ov5675_init_controls(struct ov5675 *ov5675) > { > + struct i2c_client *client = v4l2_get_subdevdata(&ov5675->sd); > struct v4l2_ctrl_handler *ctrl_hdlr; > + struct v4l2_fwnode_device_properties props; You could move the line up and maintain the (in)famous reverse-xmas-tree ordering in variable declaration. Nit apart, looks good Reviewed-by: Jacopo Mondi Thanks j > s64 exposure_max, h_blank; > int ret; > > ctrl_hdlr = &ov5675->ctrl_handler; > - ret = v4l2_ctrl_handler_init(ctrl_hdlr, 8); > + ret = v4l2_ctrl_handler_init(ctrl_hdlr, 10); > if (ret) > return ret; > > @@ -838,9 +840,23 @@ static int ov5675_init_controls(struct ov5675 *ov5675) > if (ctrl_hdlr->error) > return ctrl_hdlr->error; > > + ret = v4l2_fwnode_device_parse(&client->dev, &props); > + if (ret) > + goto error; > + > + ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &ov5675_ctrl_ops, > + &props); > + if (ret) > + goto error; > + > ov5675->sd.ctrl_handler = ctrl_hdlr; > > return 0; > + > +error: > + v4l2_ctrl_handler_free(ctrl_hdlr); > + > + return ret; > } > > static void ov5675_update_pad_format(const struct ov5675_mode *mode, > -- > 2.35.3 >