From patchwork Sun Nov 20 14:13:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 13050050 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 07C31C43217 for ; Sun, 20 Nov 2022 14:15:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229519AbiKTONQ (ORCPT ); Sun, 20 Nov 2022 09:13:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbiKTONP (ORCPT ); Sun, 20 Nov 2022 09:13:15 -0500 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24BD911A0E for ; Sun, 20 Nov 2022 06:13:11 -0800 (PST) Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id B479D85200; Sun, 20 Nov 2022 15:13:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1668953588; bh=ychfoC5HS5VEpXYoxvKbHk5rt/ZSI4r4nDmg8RY6qGE=; h=From:To:Cc:Subject:Date:From; b=wOglhAMpA/Hs4FyTCxdety194DrCD0SFhrLCYAl6AALDdF64g4GQQ1a23nR1/RIIE t3stmf2cc1vBFwiz2eC7qxxALFMD4O5kpXHrRKwXVk8+VgqMOJPDGJuESwAtrUVv7R Ejmqyg2nn/3rppImlK9TJk4cROAPIoaEMwZLKljv1CqZJVDfHVxB19ujG1jPFde260 EjV+z9tIhtntZFUGbnET6Hpp/4Avo8QSjDM+cWIjrgnu2xFJ8UkufJy9faOkiY+q0R jKorD5lG2ZY8nNR4ydThb+226hZLia+aEsyIumtu6DjsjWNXWHk5ynN6gh/ru/a5vm 2mocEUPyH9ZmQ== From: Marek Vasut To: linux-media@vger.kernel.org Cc: Marek Vasut , Laurent Pinchart , Mauro Carvalho Chehab , Sakari Ailus , Stefan Riedmueller Subject: [PATCH] media: mt9p031: Drop bogus v4l2_subdev_get_try_crop() call from mt9p031_init_cfg() Date: Sun, 20 Nov 2022 15:13:04 +0100 Message-Id: <20221120141304.80832-1-marex@denx.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The mt9p031_init_cfg() already calls __mt9p031_get_pad_crop(), which correctly calls v4l2_subdev_get_try_crop() on V4L2_SUBDEV_FORMAT_TRY or returns &mt9p031->crop on V4L2_SUBDEV_FORMAT_ACTIVE. No need to call v4l2_subdev_get_try_crop() in mt9p031_init_cfg() again in case of both V4L2_SUBDEV_FORMAT_TRY and V4L2_SUBDEV_FORMAT_ACTIVE. This also fixes a splat generated by this call since commit 2ba3e38517f5a ("media: v4l: subdev: Fail graciously when getting try data for NULL state") because v4l2_subdev_get_try_crop() is called with sd_state = NULL in mt9p031_init_cfg(). Fixes: 69681cd041648 ("media: mt9p031: Move open subdev op init code into init_cfg") Signed-off-by: Marek Vasut Reviewed-by: Laurent Pinchart --- Cc: Laurent Pinchart Cc: Mauro Carvalho Chehab Cc: Sakari Ailus Cc: Stefan Riedmueller --- drivers/media/i2c/mt9p031.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c index 5f5caafe56887..4ffc2f6e7db47 100644 --- a/drivers/media/i2c/mt9p031.c +++ b/drivers/media/i2c/mt9p031.c @@ -708,7 +708,6 @@ static int mt9p031_init_cfg(struct v4l2_subdev *subdev, V4L2_SUBDEV_FORMAT_TRY; crop = __mt9p031_get_pad_crop(mt9p031, sd_state, 0, which); - v4l2_subdev_get_try_crop(subdev, sd_state, 0); crop->left = MT9P031_COLUMN_START_DEF; crop->top = MT9P031_ROW_START_DEF; crop->width = MT9P031_WINDOW_WIDTH_DEF;