From patchwork Mon May 29 10:37:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 687122 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E6C1C7EE29 for ; Mon, 29 May 2023 10:38:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231482AbjE2Kir (ORCPT ); Mon, 29 May 2023 06:38:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230149AbjE2Kin (ORCPT ); Mon, 29 May 2023 06:38:43 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4830CCD for ; Mon, 29 May 2023 03:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685356683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pQ5ls5ttIsM7XFmyxZy3dzVMD6iAvyK5KCgN+W4YE+s=; b=FeHdgTN9u+UcYoPTG3fg1KKrvjLnKXbRTROeG+QpPRf9Ao2DXm2aeDr6o1R5QlJOMaRLRW HQqd+UQPKm7TesGNCOpizSujLcotCP8qEuN/8TDHlU8NWlyXXAUqX/iYa4FKsxJAY85xFC JK6eXcORkbRV9F9NmhbtNfJR9nq6ka8= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-635-Dqofvci_M_ej8c3TySuSBA-1; Mon, 29 May 2023 06:37:59 -0400 X-MC-Unique: Dqofvci_M_ej8c3TySuSBA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0FD9C38184E5; Mon, 29 May 2023 10:37:59 +0000 (UTC) Received: from localhost.localdomain (unknown [10.39.194.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C7152166B2B; Mon, 29 May 2023 10:37:57 +0000 (UTC) From: Hans de Goede To: Mauro Carvalho Chehab , Sakari Ailus , Andy Shevchenko Cc: Hans de Goede , Kate Hsuan , Tsuchiya Yuto , Yury Luneff , Nable , andrey.i.trufanov@gmail.com, Fabio Aiuto , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 04/21] media: atomisp: ov2680: Add missing ov2680_calc_mode() call to probe() Date: Mon, 29 May 2023 12:37:24 +0200 Message-Id: <20230529103741.11904-5-hdegoede@redhat.com> In-Reply-To: <20230529103741.11904-1-hdegoede@redhat.com> References: <20230529103741.11904-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Call ov2680_calc_mode() from probe() instead of relying on userspace to make at least one s_fmt call to fill the mode parameters. Signed-off-by: Hans de Goede --- drivers/staging/media/atomisp/i2c/atomisp-ov2680.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c index 8bcfa5ae2ea0..6cbc470bce91 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c @@ -195,8 +195,10 @@ static void ov2680_fill_format(struct ov2680_dev *sensor, ov2680_set_bayer_order(sensor, fmt); } -static void ov2680_calc_mode(struct ov2680_dev *sensor, int width, int height) +static void ov2680_calc_mode(struct ov2680_dev *sensor) { + int width = sensor->mode.fmt.width; + int height = sensor->mode.fmt.height; int orig_width = width; int orig_height = height; @@ -338,7 +340,7 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd, return 0; mutex_lock(&sensor->lock); - ov2680_calc_mode(sensor, fmt->width, fmt->height); + ov2680_calc_mode(sensor); mutex_unlock(&sensor->lock); return 0; } @@ -660,6 +662,7 @@ static int ov2680_probe(struct i2c_client *client) } ov2680_fill_format(sensor, &sensor->mode.fmt, OV2680_NATIVE_WIDTH, OV2680_NATIVE_HEIGHT); + ov2680_calc_mode(sensor); ret = v4l2_async_register_subdev_sensor(&sensor->sd); if (ret) {