Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2060540rwa; Mon, 22 Aug 2022 01:03:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR4sTARERMegsVEvYC6cF+Zx6sRHB0NQ2q5M57LXWuJf64LJ+ablh394EfbDHcvIsI0mgZYv X-Received: by 2002:a17:906:6a10:b0:730:e9bd:1110 with SMTP id qw16-20020a1709066a1000b00730e9bd1110mr12032158ejc.88.1661155399057; Mon, 22 Aug 2022 01:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661155399; cv=none; d=google.com; s=arc-20160816; b=auKeMh/3JWw5jT1LWnYJukxaQOBtllr4IrTfDgJAZMxHlzak7Mi9pPl5kvOUzqnPJy 6CWwgSqhvQCIYFXujRPkqX1Mu6JK4Z34o7Np7Ng/gc4j0sNJ3K/n1vrCW1LIH/hMgnRF TJ2RF8gTWEKTFtriK+JXGaJ4WQLONdbKLj2QNstzs8/w6IuAnPyYDQM3AUO9j6cSe75a r/TRpByx8Q7rdfGmvSQrImKnUKOI+AGhCb3F5lV6rjLr/TzLPAJAAcPNgVq7/A8J2xbT EkkBeU1QiKzzV1DFG71BEVflsuruSV5Qclk8f8VTwATlSZxJJrf/ZPTqfP9K6kJl9zLJ ewAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=YQO6KD5t0S4J9ylwaW8al2w1/YibgorVWVyv9kxY1ak=; b=wwd40P7L+6bZ12AQa4wdt3fobX7Pe/ovc6pn63BVtg8+8VEDvmAkc2Oozd3EDOEKj6 nSofP7KshXu8WnuJgQ4ejYwGEoIy7QDFoA64N2MwtSA/S2bm4l/HzPF2jaDPMS1+3YR/ zy6V9+Xjw5NlIlrGx5IiUhSOTKxe3XJuvXKirC2IEu34+Rit6r8p209ovVeHYPZHWURA 31/VJWWUTEau4ZJzVhnLD0gIJ2zhO0L+9yTYjjFkATjgXGiEZOXnoz+l9N3yAR+ot0WC fV/xWgn+LnaH8VExPS+TrJC2PXY6GCZhCo/+XejNqlhNn6AMi+IJ6az5f4SV7VbtCOzH X1qA== 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 f14-20020a056402354e00b0043b644f0175si10257711edd.88.2022.08.22.01.02.50; Mon, 22 Aug 2022 01:03:19 -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 S233022AbiHVHvN (ORCPT + 99 others); Mon, 22 Aug 2022 03:51:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233445AbiHVHvL (ORCPT ); Mon, 22 Aug 2022 03:51:11 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EFA12AE0D for ; Mon, 22 Aug 2022 00:51:10 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQ2D8-0001Hr-1H; Mon, 22 Aug 2022 09:51:02 +0200 Received: from mfe by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1oQ2D7-000666-1O; Mon, 22 Aug 2022 09:51:01 +0200 Date: Mon, 22 Aug 2022 09:51:01 +0200 From: Marco Felsch To: Sakari Ailus Cc: mchehab@kernel.org, laurent.pinchart+renesas@ideasonboard.com, jacopo+renesas@jmondi.org, akinobu.mita@gmail.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH 2/4] media: mt9m111: fix subdev API usage Message-ID: <20220822075101.75dv3cv2evb2qeqq@pengutronix.de> References: <20220818144712.997477-1-m.felsch@pengutronix.de> <20220818144712.997477-2-m.felsch@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Sakari, On 22-08-22, Sakari Ailus wrote: > Hi Marco, > > On Thu, Aug 18, 2022 at 04:47:10PM +0200, Marco Felsch wrote: > > In case of I2C transfer failures the driver return failure codes which > > are not allowed according the API documentation. Fix that by ignore the > > register access failure codes. > > > > Signed-off-by: Marco Felsch > > --- > > drivers/media/i2c/mt9m111.c | 116 ++++++++++++++++++++---------------- > > 1 file changed, 66 insertions(+), 50 deletions(-) > > > > diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c > > index cdaf283e1309..53c4dac4e4bd 100644 > > --- a/drivers/media/i2c/mt9m111.c > > +++ b/drivers/media/i2c/mt9m111.c > > @@ -455,7 +455,7 @@ static int mt9m111_set_selection(struct v4l2_subdev *sd, > > struct mt9m111 *mt9m111 = to_mt9m111(client); > > struct v4l2_rect rect = sel->r; > > int width, height; > > - int ret, align = 0; > > + int align = 0; > > > > if (sel->which != V4L2_SUBDEV_FORMAT_ACTIVE || > > sel->target != V4L2_SEL_TGT_CROP) > > @@ -481,14 +481,13 @@ static int mt9m111_set_selection(struct v4l2_subdev *sd, > > width = min(mt9m111->width, rect.width); > > height = min(mt9m111->height, rect.height); > > > > - ret = mt9m111_setup_geometry(mt9m111, &rect, width, height, mt9m111->fmt->code); > > - if (!ret) { > > - mt9m111->rect = rect; > > - mt9m111->width = width; > > - mt9m111->height = height; > > - } > > > > - return ret; > > + mt9m111_setup_geometry(mt9m111, &rect, width, height, mt9m111->fmt->code); > > If the function can fail, it'd be much better to move it to s_stream > callback than ignore the error. > > Same for the rest of such changes. I did that in the following patch, but I can merge them if you want. Regards, Marco