Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp433092rdb; Wed, 20 Dec 2023 01:08:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxwOUqXYleFcNv4GeCMFE6zu0NbRqaLdeczr88a4I0gbvr3EF3kesp5oa0ZLv3BabjHls1 X-Received: by 2002:a05:620a:260e:b0:77d:7a58:51cf with SMTP id z14-20020a05620a260e00b0077d7a5851cfmr23296356qko.43.1703063314434; Wed, 20 Dec 2023 01:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703063314; cv=none; d=google.com; s=arc-20160816; b=AzLMlUDMg5tPt2nuokZ9tkY+WLvhHB3CFSBLIJRrEIj0pCSl6XCuSxXa+Jt3sm8bkI Fw4J5Td7SdUpYQ83G6loIAORaIe/gx980+E99FD08sPhL78TgphvtY89IXxtQVgCmlQc ydtqLKhGW6BkL9dgIddkBbqKNysasKUsuC+AsWcn6uwLls3k9rbVV3GXXmjOz7DqfMxk Mg3pPU1D6kXmoTmVrhzZyV/aKGvgQ4hjhX7dou8JFyPaXX69eiijZIephWEXWKoSKHTJ d3KmLcT9X+SCt4syirCEnJUOcJqZIemXsGSEj4eu9YUufOrAV2RRhpZNQNolA6SWwvCU ClVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Yvx/pKxw13Q7lCkhPkPOFoVTTvsh/bx2F8zF4+0mqBs=; fh=yFFfmksCYrZx9KBlBazuNGjXI8fgCRbzhjFy6n9sUxM=; b=xmEOVgc/MKbXARn/dJoPVDpJQDKkmbWOy2xTFkijoDzyIp6308PhRlZ7LMjM3MCRRk baR25o4JXZns4m8xxqpM/wE4j9RwJvg8k76w/8kkczXqo61ElRxy5F/thaiXLc6SDHor fmTXcn9zFTsriipUNJ2l6o3xfmFcPSQMm8Q5XF6hUR6INhjBS3RpgdVOc4REuRRJ1p4p Px3LHOwJ2TTTLgKqRfkHYJL+Uv3hO3FFVkhkMCbkjzAtsC8hPPpfVAS8+guLo3iA/DF0 A8zf2g7V5C830nePU29QTkheTcFba7X3fSzqvYCmjKX4sPBPTjvyZZyxAyoBD76jGqwj +vkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="D//bHVR6"; spf=pass (google.com: domain of linux-kernel+bounces-6620-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6620-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h4-20020a05620a284400b0077da7c84a5asi41053qkp.53.2023.12.20.01.08.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 01:08:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6620-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="D//bHVR6"; spf=pass (google.com: domain of linux-kernel+bounces-6620-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6620-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1E8E81C256DC for ; Wed, 20 Dec 2023 09:08:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 628721D6B6; Wed, 20 Dec 2023 09:08:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="D//bHVR6" X-Original-To: linux-kernel@vger.kernel.org Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2D111CFAD; Wed, 20 Dec 2023 09:08:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 74441833; Wed, 20 Dec 2023 10:07:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1703063243; bh=2eZY8RgaVUNw5VVbrAFpmMJDkj7arLe26QC8zLFhMMk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D//bHVR6oH1vYCzeD/iXlTjrrxHuZNiW7ix7xQuvtCxncYoZelWIcLNJUp22Tt63A 8cq1yJg62cprOHpvDCbEP6CIp0c1x8E4z89qsktVyQLtCQ07b1F6LBKHvGzQTjFae4 /2xaoc5dORrp8/NOTketpObOY/Hu2uTZe2Y69mwk= Date: Wed, 20 Dec 2023 11:08:20 +0200 From: Laurent Pinchart To: Tommaso Merciai Cc: linuxfancy@googlegroups.com, martin.hecht@avnet.eu, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/4] media: i2c: alvium: removal of dft_fr, min_fr and max_fr Message-ID: <20231220090820.GF29638@pendragon.ideasonboard.com> References: <20231220085609.2595732-1-tomm.merciai@gmail.com> <20231220085609.2595732-2-tomm.merciai@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231220085609.2595732-2-tomm.merciai@gmail.com> Hi Tommaso, Thank you for the patch. On Wed, Dec 20, 2023 at 09:56:06AM +0100, Tommaso Merciai wrote: > The dft_fr, min_fr and max_fr fields of the alvium_dev structure are > only used to pass results from alvium_get_frame_interval() to its > caller. Replace them with function parameters. > > Signed-off-by: Tommaso Merciai Reviewed-by: Laurent Pinchart > --- > Changes Since v1: > - Fixed commit body as suggested by LPinchart > - Fixed alvium_get_frame_interval just return ret as suggested by LPinchart > - Removed unrelated chnages from the commit as suggested by LPinchart > > drivers/media/i2c/alvium-csi2.c | 27 +++++++++------------------ > drivers/media/i2c/alvium-csi2.h | 3 --- > 2 files changed, 9 insertions(+), 21 deletions(-) > > diff --git a/drivers/media/i2c/alvium-csi2.c b/drivers/media/i2c/alvium-csi2.c > index 34ff7fad3877..0dcd69bf9f92 100644 > --- a/drivers/media/i2c/alvium-csi2.c > +++ b/drivers/media/i2c/alvium-csi2.c > @@ -1170,25 +1170,19 @@ static int alvium_set_bayer_pattern(struct alvium_dev *alvium, > return 0; > } > > -static int alvium_get_frame_interval(struct alvium_dev *alvium) > +static int alvium_get_frame_interval(struct alvium_dev *alvium, > + u64 *dft_fr, u64 *min_fr, u64 *max_fr) > { > - u64 dft_fr, min_fr, max_fr; > int ret = 0; > > alvium_read(alvium, REG_BCRM_ACQUISITION_FRAME_RATE_RW, > - &dft_fr, &ret); > + dft_fr, &ret); > alvium_read(alvium, REG_BCRM_ACQUISITION_FRAME_RATE_MIN_R, > - &min_fr, &ret); > + min_fr, &ret); > alvium_read(alvium, REG_BCRM_ACQUISITION_FRAME_RATE_MAX_R, > - &max_fr, &ret); > - if (ret) > - return ret; > - > - alvium->dft_fr = dft_fr; > - alvium->min_fr = min_fr; > - alvium->max_fr = max_fr; > + max_fr, &ret); > > - return 0; > + return ret; > } > > static int alvium_set_frame_rate(struct alvium_dev *alvium) > @@ -1670,21 +1664,18 @@ static int alvium_set_frame_interval(struct alvium_dev *alvium, > struct v4l2_subdev_frame_interval *fi) > { > struct device *dev = &alvium->i2c_client->dev; > - u64 req_fr, min_fr, max_fr; > + u64 req_fr, dft_fr, min_fr, max_fr; > int ret; > > if (fi->interval.denominator == 0) > return -EINVAL; > > - ret = alvium_get_frame_interval(alvium); > + ret = alvium_get_frame_interval(alvium, &dft_fr, &min_fr, &max_fr); > if (ret) { > dev_err(dev, "Fail to get frame interval\n"); > return ret; > } > > - min_fr = alvium->min_fr; > - max_fr = alvium->max_fr; > - > dev_dbg(dev, "fi->interval.numerator = %d\n", > fi->interval.numerator); > dev_dbg(dev, "fi->interval.denominator = %d\n", > @@ -1694,7 +1685,7 @@ static int alvium_set_frame_interval(struct alvium_dev *alvium, > fi->interval.numerator); > > if (req_fr >= max_fr && req_fr <= min_fr) > - req_fr = alvium->dft_fr; > + req_fr = dft_fr; > > alvium->fr = req_fr; > alvium->frame_interval.numerator = fi->interval.numerator; > diff --git a/drivers/media/i2c/alvium-csi2.h b/drivers/media/i2c/alvium-csi2.h > index b85a25169e79..17f0bbbd1839 100644 > --- a/drivers/media/i2c/alvium-csi2.h > +++ b/drivers/media/i2c/alvium-csi2.h > @@ -443,9 +443,6 @@ struct alvium_dev { > > struct alvium_mode mode; > struct v4l2_fract frame_interval; > - u64 dft_fr; > - u64 min_fr; > - u64 max_fr; > u64 fr; > > u8 h_sup_csi_lanes; -- Regards, Laurent Pinchart