From mboxrd@z Thu Jan 1 00:00:00 1970 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 0E824C38A2D for ; Mon, 24 Oct 2022 16:19:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234352AbiJXQSw (ORCPT ); Mon, 24 Oct 2022 12:18:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234220AbiJXQRI (ORCPT ); Mon, 24 Oct 2022 12:17:08 -0400 Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [IPv6:2001:4b98:dc4:8::240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 070A1B18F0 for ; Mon, 24 Oct 2022 08:04:17 -0700 (PDT) Received: from relay9-d.mail.gandi.net (unknown [217.70.183.199]) by mslow1.mail.gandi.net (Postfix) with ESMTP id A2C9FC0F35 for ; Mon, 24 Oct 2022 13:11:29 +0000 (UTC) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id 81AE5FF804; Mon, 24 Oct 2022 13:10:47 +0000 (UTC) Date: Mon, 24 Oct 2022 15:10:45 +0200 From: Jacopo Mondi To: Dave Stevenson Cc: Krzysztof =?utf-8?Q?Ha=C5=82asa?= , Mauro Carvalho Chehab , Sakari Ailus , Laurent Pinchart , linux-media@vger.kernel.org Subject: Re: [PATCH v2 05/10] media: ar0521: Refuse unsupported controls Message-ID: <20221024131045.jyi3yoqtmpvdaaga@uno.localdomain> References: <20221022092015.208592-1-jacopo@jmondi.org> <20221022092015.208592-6-jacopo@jmondi.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Ups, trivial mistake sorry Thanks for spotting On Mon, Oct 24, 2022 at 02:00:28PM +0100, Dave Stevenson wrote: > Hi Jacopo > > On Sat, 22 Oct 2022 at 11:13, Jacopo Mondi wrote: > > > > Refuse unsupported controls by returning -EINVAL in the s_ctrl > > operation. > > > > Signed-off-by: Jacopo Mondi > > > > --- > > drivers/media/i2c/ar0521.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/media/i2c/ar0521.c b/drivers/media/i2c/ar0521.c > > index e673424880ac..fcd852760750 100644 > > --- a/drivers/media/i2c/ar0521.c > > +++ b/drivers/media/i2c/ar0521.c > > @@ -547,6 +547,10 @@ static int ar0521_s_ctrl(struct v4l2_ctrl *ctrl) > > ret = ar0521_write_reg(sensor, AR0521_REG_TEST_PATTERN_MODE, > > ctrl->val); > > break; > > + default: > > + dev_err(&sensor->i2c_client->dev, > > + "Unsupported control %x\n", ctrl->id); > > + return -EINVAL; > > } > > > > pm_runtime_put(&sensor->i2c_client->dev); > > In the default case you've returned without doing the pm_runtime_put, > so pm is going to be unbalanced. > > default: > dev_err(...) > ret = -EINVAL; > break; > would avoid that. > > Dave > > > -- > > 2.37.3 > >