From patchwork Wed Apr 17 14:06:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10905361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E6BA01515 for ; Wed, 17 Apr 2019 14:06:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D305A285A5 for ; Wed, 17 Apr 2019 14:06:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C716E2874E; Wed, 17 Apr 2019 14:06:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72C12285A5 for ; Wed, 17 Apr 2019 14:06:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732300AbfDQOG6 (ORCPT ); Wed, 17 Apr 2019 10:06:58 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45931 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729395AbfDQOG5 (ORCPT ); Wed, 17 Apr 2019 10:06:57 -0400 Received: by mail-pf1-f195.google.com with SMTP id e24so12150220pfi.12 for ; Wed, 17 Apr 2019 07:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eIqEivdb8SjPK/zHYSaRKQktoBq5eXpt3dgLLDl5C9U=; b=ZWbm+yFEQfyG7GLqujm3VDrmRL6DPbiq5Un1vzXz5NMc2pNrcjBoy3D+kHWbVyMUX4 mNLdeXY/AAizVsDnw7LALDbVsQBheg0onte7Pq4jeFm1xZPa/3osDJehfebRMe2dkW6V f8rKcASArXmSruYrvBXjbXqJ2nuCCVBHS28e0hH9SgP3OfC13NX4qPMEf9qMbNWMP1ZU aUSXsR/uo6I1LRqY+fujuWuMiB7hJAeRuiV7LXk8BfdCmyn6Fq0H9T3wW5NNDnDTuu+S j0L0IWbVAPlM8d0RX6TGDscCNUebE4NdZMepyInklPnMGyqgH295BW+fNz4M8VfGxRq9 cE5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eIqEivdb8SjPK/zHYSaRKQktoBq5eXpt3dgLLDl5C9U=; b=Nfuw8SSDM175Req9xhnPyKeK8io43gWzSK9t9SyGtT76NMeCTOxJ6JABbtAJ7IOlzf 0OR97r6ZCqmT6GvH3aCkB+HFTsA7pLUt2BYq73Ydawe8QJZETgs3jBQpOnBxf6LlFuRb uLzR2zNfT2+HP4vKBnMRJOJ2nn+N1S3fKayQE85l9zyQQoo2dOagLUmSowfOMVPvrC36 lk22K3qd6Zz/ZXTCzEr6hdHnb/kkZosUEWwjIHf25aSSZpwZjkaPaPV0CsIvEvhH9zcU 4jfsJdBWpRIDXwxnt9bIr74d5ySm2sZGnaxfY9j9nXMMl3Sh8GTX0QKc6MPvmKyheMGf Ci1Q== X-Gm-Message-State: APjAAAXTsJEIn2Lqv+yXiPmNZnHXS9cXfzY6gWHuzGrCW5qhZAAEBIPY XZNperAcrOtQzwQGeYbzIGsM5kC4 X-Google-Smtp-Source: APXvYqx7j3xeu1asI+87y0aVSCG5OHi7UdvVENpoOgoBpBXbJGbVv8mtav2MVnI0zMa/tSNmTbywrg== X-Received: by 2002:a62:ab14:: with SMTP id p20mr89330028pff.23.1555510016811; Wed, 17 Apr 2019 07:06:56 -0700 (PDT) Received: from localhost.localdomain ([240f:34:212d:1:1b24:991b:df50:ea3f]) by smtp.gmail.com with ESMTPSA id t82sm144498222pfa.153.2019.04.17.07.06.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Apr 2019 07:06:56 -0700 (PDT) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Wenyou Yang , Eugen Hristev , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 1/4] media: ov7740: fix unbalanced pm_runtime_get/put Date: Wed, 17 Apr 2019 23:06:38 +0900 Message-Id: <1555510001-23922-2-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555510001-23922-1-git-send-email-akinobu.mita@gmail.com> References: <1555510001-23922-1-git-send-email-akinobu.mita@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid returning without decrement the usage count in s_ctrl(). Cc: Wenyou Yang Cc: Eugen Hristev Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/ov7740.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/ov7740.c b/drivers/media/i2c/ov7740.c index 54e80a6..d122e35 100644 --- a/drivers/media/i2c/ov7740.c +++ b/drivers/media/i2c/ov7740.c @@ -561,16 +561,16 @@ static int ov7740_set_ctrl(struct v4l2_ctrl *ctrl) break; case V4L2_CID_AUTOGAIN: if (!ctrl->val) - return ov7740_set_gain(regmap, ov7740->gain->val); - - ret = ov7740_set_autogain(regmap, ctrl->val); + ret = ov7740_set_gain(regmap, ov7740->gain->val); + else + ret = ov7740_set_autogain(regmap, ctrl->val); break; case V4L2_CID_EXPOSURE_AUTO: if (ctrl->val == V4L2_EXPOSURE_MANUAL) - return ov7740_set_exp(regmap, ov7740->exposure->val); - - ret = ov7740_set_autoexp(regmap, ctrl->val); + ret = ov7740_set_exp(regmap, ov7740->exposure->val); + else + ret = ov7740_set_autoexp(regmap, ctrl->val); break; default: ret = -EINVAL; From patchwork Wed Apr 17 14:06:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10905363 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE2281515 for ; Wed, 17 Apr 2019 14:07:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7199285A5 for ; Wed, 17 Apr 2019 14:07:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8B4A2874E; Wed, 17 Apr 2019 14:07:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 504C6285A5 for ; Wed, 17 Apr 2019 14:07:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732379AbfDQOG7 (ORCPT ); Wed, 17 Apr 2019 10:06:59 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40063 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729395AbfDQOG7 (ORCPT ); Wed, 17 Apr 2019 10:06:59 -0400 Received: by mail-pl1-f195.google.com with SMTP id b3so12093480plr.7 for ; Wed, 17 Apr 2019 07:06:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=us9G18P81iar7rzB08BUB/hHQo8AUsxOaKRGG9gYJGg=; b=HOIYjStBKkBQeswoVSsCQ8rDMT1bg3gd/2B7xu4AINLdFmnNps+Or275YbaZKmCPZf Qsp00pkYmdqWDYbdIG1HsXvdlKcpHlal3yE5EYWhHrw2t9BPftyrkTJEywmopa5Mu8gA 6tdt/j2g9oTB0QBs/4P+bBcogf0k+FbiqAsGMQmrAluliC36LJVIMeZc1MGIMXb6Aj9h 5SLp5Dq2bxCyxfULAM/ZJt5kZzWWeEvFJLeJJGJdjwAslUZSeFvgQOJAPsD8Hu+SJ52O k716HzP0+FA/zk0OclzNeef+59uaYQZ1CM+bmYn88fadYP+dcrfQsFwIUYoMiG2dZTS/ 7N2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=us9G18P81iar7rzB08BUB/hHQo8AUsxOaKRGG9gYJGg=; b=rWn+TEUsDc6R/WHWnABVdMbfD0WkyPfvVqMhb70iT/E3VYmdYkmro3vh2Xd7RQsU0N wjrQiN7el5GTZmPMQv2RV9hY2mcAwwbebIdZffk9TSDLkWYj2u45LLrxgVpiW4Zh2ze3 m2Q0l1ebwOJX+jaSW2NZauZ7FjDVhBYigq5vGwlez1jMinHgecxz8oSElmd88jBxVNpM S2HmL3KP6cl561G4hnsXSJ5cpJmGvH3RZZuCxIOPZBM/yyGvW/hq58FWn9UBmErpuSPy B9uzbxrg1OtlXAda5M0DuZ3/5inCecNH2l15yz704JITm5YA6dXCk6JGW7FJecgUB2O9 em7Q== X-Gm-Message-State: APjAAAUEj55YC1YvH38vhQvTbR0rXyzKsCHfLzLCype+Mh1tinkDABfo JNtB0zdnNapbMGUJg7BuAA73razo X-Google-Smtp-Source: APXvYqwm46WwjE/5RIQ5liMEsHUL0awnOTBhP12J4tjb9ANxHFJCd/A8yCOJijVyTln8VIVnfX5MGQ== X-Received: by 2002:a17:902:e183:: with SMTP id cd3mr73394227plb.233.1555510019013; Wed, 17 Apr 2019 07:06:59 -0700 (PDT) Received: from localhost.localdomain ([240f:34:212d:1:1b24:991b:df50:ea3f]) by smtp.gmail.com with ESMTPSA id t82sm144498222pfa.153.2019.04.17.07.06.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Apr 2019 07:06:58 -0700 (PDT) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Wenyou Yang , Eugen Hristev , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 2/4] media: ov7740: avoid invalid framesize setting Date: Wed, 17 Apr 2019 23:06:39 +0900 Message-Id: <1555510001-23922-3-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555510001-23922-1-git-send-email-akinobu.mita@gmail.com> References: <1555510001-23922-1-git-send-email-akinobu.mita@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the requested framesize by VIDIOC_SUBDEV_S_FMT is larger than supported framesizes, it causes an out of bounds array access and the resulting framesize is unexpected. Avoid out of bounds array access and select the default framesize. Cc: Wenyou Yang Cc: Eugen Hristev Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/ov7740.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov7740.c b/drivers/media/i2c/ov7740.c index d122e35..5c0dfdf 100644 --- a/drivers/media/i2c/ov7740.c +++ b/drivers/media/i2c/ov7740.c @@ -785,7 +785,11 @@ static int ov7740_try_fmt_internal(struct v4l2_subdev *sd, fsize++; } - + if (i >= ARRAY_SIZE(ov7740_framesizes)) { + fsize = &ov7740_framesizes[0]; + fmt->width = fsize->width; + fmt->height = fsize->height; + } if (ret_frmsize != NULL) *ret_frmsize = fsize; From patchwork Wed Apr 17 14:06:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10905365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 647A414DB for ; Wed, 17 Apr 2019 14:07:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F9FD285A5 for ; Wed, 17 Apr 2019 14:07:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42BD22874E; Wed, 17 Apr 2019 14:07:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D931F285A5 for ; Wed, 17 Apr 2019 14:07:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732388AbfDQOHC (ORCPT ); Wed, 17 Apr 2019 10:07:02 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44971 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729395AbfDQOHC (ORCPT ); Wed, 17 Apr 2019 10:07:02 -0400 Received: by mail-pl1-f193.google.com with SMTP id g12so12066323pll.11 for ; Wed, 17 Apr 2019 07:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2tGYYamzoV0YMO6GpLIy/3DeA+mGZ0ak/RzXNmUlqd4=; b=nYfjv37Xjo9Fl0Y4uN97OHZMhnejJ3yYqqyzcDMMscGfDngYm9O3PmVx4Qz6NYJBvJ IjR5D6Jr9rQV2oTOIhAIFLbMrPyKk14QWJKSBKjyJtqt6Kwcn/gaiwQCN11pdw4RIwCq HX9mxCVFrOXvexISDxuSDhmHzIaOOZfCgI0hyilTabRGdWQ3+biYJgEgwz7zZ28SV75W DywWS70pRIxGHUcPVNY7TNr9Od/OKFAQdSaXyXI13zDCEJgN/pWKfR4/pLF9kUQxkve/ pCQCxZz6xV6mcKbMCGUKct5RYKLWq2ox4UwNR7hhJ9Cot8iWft1q1a4rEjbJZ8WSeJBL v6oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2tGYYamzoV0YMO6GpLIy/3DeA+mGZ0ak/RzXNmUlqd4=; b=ctBKO+721DWmxPklA0nc0IigDBVp4npotRea+V1mAo5mVS4dlPd7YM7WMMyJgJ1pV2 YQF4OhuRDOiqdadVkeIvQ3gf7aMLBVFcCbaxVNlckBQZ7NQYI/sQyt2hfi87UsVmFLcX 8MlHTNrmXLlOAFt4LbUO4O/wcrz+8e3nJZt7cTkH3TLbbo6KLNXjYD3yLf6IPqhyK5Aw LhncQiVwubk88wDt0iUeXEl20665X4c81dOCFjwxCuwsmyOnx7LIgLZwwT4VxvUfGcuz WVU/s4lB2YgYuFTK01COI/MgthQ2y1QJfkxAKjH3k34IPjjowaweVrW0KVRUkWcaQoEg YQJg== X-Gm-Message-State: APjAAAWB6nJr/XcSn9BqmH8BBQfzXCwNCECubDsgwYwNdX3m73IW22AH /zu5vKnD8TvS9SKw3RiFB7qg6oWx X-Google-Smtp-Source: APXvYqzYiSXd0TO1rgqAVKPjtH3GpQMvMhCJu9+mwZNVYNStQlQVgBg0vYtjANklTRpcs/fixK2J/w== X-Received: by 2002:a17:902:29:: with SMTP id 38mr66491433pla.178.1555510021246; Wed, 17 Apr 2019 07:07:01 -0700 (PDT) Received: from localhost.localdomain ([240f:34:212d:1:1b24:991b:df50:ea3f]) by smtp.gmail.com with ESMTPSA id t82sm144498222pfa.153.2019.04.17.07.06.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Apr 2019 07:07:00 -0700 (PDT) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Wenyou Yang , Eugen Hristev , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 3/4] media: ov7740: fix vertical flip control Date: Wed, 17 Apr 2019 23:06:40 +0900 Message-Id: <1555510001-23922-4-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555510001-23922-1-git-send-email-akinobu.mita@gmail.com> References: <1555510001-23922-1-git-send-email-akinobu.mita@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Setting the value of the V4L2_CID_VFLIP control is currently ignored. Because V4L2_CID_HFLIP and V4L2_CID_VFLIP are independently controlled in s_ctrl() but these controls belong to the same cluster and the first control is V4L2_CID_HFLIP. Fix it by not clustering these controls. Also correct erroneous updating register bit for vertical flip. Cc: Wenyou Yang Cc: Eugen Hristev Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/ov7740.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov7740.c b/drivers/media/i2c/ov7740.c index 5c0dfdf..352658b 100644 --- a/drivers/media/i2c/ov7740.c +++ b/drivers/media/i2c/ov7740.c @@ -532,7 +532,7 @@ static int ov7740_set_ctrl(struct v4l2_ctrl *ctrl) struct i2c_client *client = v4l2_get_subdevdata(&ov7740->subdev); struct regmap *regmap = ov7740->regmap; int ret; - u8 val = 0; + u8 val; if (!pm_runtime_get_if_in_use(&client->dev)) return 0; @@ -551,6 +551,7 @@ static int ov7740_set_ctrl(struct v4l2_ctrl *ctrl) ret = ov7740_set_contrast(regmap, ctrl->val); break; case V4L2_CID_VFLIP: + val = ctrl->val ? REG0C_IMG_FLIP : 0x00; ret = regmap_update_bits(regmap, REG_REG0C, REG0C_IMG_FLIP, val); break; @@ -1030,7 +1031,6 @@ static int ov7740_init_controls(struct ov7740 *ov7740) v4l2_ctrl_auto_cluster(2, &ov7740->auto_gain, 0, true); v4l2_ctrl_auto_cluster(2, &ov7740->auto_exposure, V4L2_EXPOSURE_MANUAL, true); - v4l2_ctrl_cluster(2, &ov7740->hflip); if (ctrl_hdlr->error) { ret = ctrl_hdlr->error; From patchwork Wed Apr 17 14:06:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10905367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5DE9C14DB for ; Wed, 17 Apr 2019 14:07:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49C9B2874E for ; Wed, 17 Apr 2019 14:07:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E87828753; Wed, 17 Apr 2019 14:07:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4631285A5 for ; Wed, 17 Apr 2019 14:07:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732428AbfDQOHE (ORCPT ); Wed, 17 Apr 2019 10:07:04 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:38125 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732415AbfDQOHE (ORCPT ); Wed, 17 Apr 2019 10:07:04 -0400 Received: by mail-pl1-f194.google.com with SMTP id f36so12103888plb.5 for ; Wed, 17 Apr 2019 07:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NPgOQBXzW4Ol5dUsHFFFHYnkL55V442tMVIw3BHYqEs=; b=nST7WThOA1OEh9CHGKmTqAuA3jFvgDIBur4sIObiv4m5w18NutPB1nTaDdeLfkoeuR /Uya9v0h+Q1qtBqi6pTfvCVkVIwMncS/7QEsUgAkjeDr6hF1D9mo+87vx/bwEBaOeGLd LQxVtaCQMR0g2eyooyeZCdbCv37QYL4QX3T2LSYCR1wWmVLQDwFE5waRFfvgLcLj1s7a A4zGWedRakl2DWERQEtPoAkCSy48GnaA2R1+8LotctMqV/NTWx8UxjHkl0AzPStaB+OD ijfkjVe5dgPZZaHFNsKtJppdB80mcRXBm/KjT/vjv8KNT2QDP2Y1dYGtwkvoHdsSKQC9 BrZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NPgOQBXzW4Ol5dUsHFFFHYnkL55V442tMVIw3BHYqEs=; b=dahP2nHl68MJZwSCD/7M5UtoQ91CPco+l6YTU1io3098rZrkw7z6sTd3N4WVqxWhlt rA3IxZ75kFltMvbFFebP67R9IO1lmsNIM11HVDjMpkx/po0vfqUBvLp4RAIk6HNLywI3 PPCSEOaCl3nnJ1s3z/4ZnMyd5BuolMfVqGO/wVy+8oVJhVM4AUHQ5K8O7oUrdJ2ZTvs1 Sy6kDFGuHrfe/5cW07S1Z011AuECAZxMsJ9iqfa3zqB0OibBx1us37kTIygfhjgUpMPr zRTXthY776mBZclS97B0mbaYvea+hCijuiCs/68dd+E25u91I0OsJwGZuVmZC3RQHtG9 j4jw== X-Gm-Message-State: APjAAAUj8J/ZHwYZdUkxTowNX1SInjDJON0qRt1g0OGhS6JPThScz6YV aJiJYVPlKtG2pcZ5Za4aufO5Bw35 X-Google-Smtp-Source: APXvYqzpMHmgfMcWQKmxgU9/GiY7z6FzLo+Zmwn0xbDr6I61+P5dhzabLF0j0l+FbXlrnKiRV6xMyw== X-Received: by 2002:a17:902:2962:: with SMTP id g89mr40231003plb.264.1555510023557; Wed, 17 Apr 2019 07:07:03 -0700 (PDT) Received: from localhost.localdomain ([240f:34:212d:1:1b24:991b:df50:ea3f]) by smtp.gmail.com with ESMTPSA id t82sm144498222pfa.153.2019.04.17.07.07.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Apr 2019 07:07:02 -0700 (PDT) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Wenyou Yang , Eugen Hristev , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 4/4] media: ov7740: remove redundant V4L2_CTRL_FLAG_VOLATILE set Date: Wed, 17 Apr 2019 23:06:41 +0900 Message-Id: <1555510001-23922-5-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555510001-23922-1-git-send-email-akinobu.mita@gmail.com> References: <1555510001-23922-1-git-send-email-akinobu.mita@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the v4l2 controls are set up for autofoo/foo-type handling by calling v4l2_ctrl_auto_cluster() with the last set_volatile argument setting true, each non-auto control doesn't need to be flagged V4L2_CTRL_FLAG_VOLATILE. Cc: Wenyou Yang Cc: Eugen Hristev Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/ov7740.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/i2c/ov7740.c b/drivers/media/i2c/ov7740.c index 352658b..70bb870 100644 --- a/drivers/media/i2c/ov7740.c +++ b/drivers/media/i2c/ov7740.c @@ -1012,8 +1012,6 @@ static int ov7740_init_controls(struct ov7740 *ov7740) ov7740->gain = v4l2_ctrl_new_std(ctrl_hdlr, &ov7740_ctrl_ops, V4L2_CID_GAIN, 0, 1023, 1, 500); - if (ov7740->gain) - ov7740->gain->flags |= V4L2_CTRL_FLAG_VOLATILE; ov7740->auto_gain = v4l2_ctrl_new_std(ctrl_hdlr, &ov7740_ctrl_ops, V4L2_CID_AUTOGAIN, 0, 1, 1, 1);