Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp119931rdb; Tue, 31 Oct 2023 02:34:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEuXHHMwT4XoQHwaecGx26yjbbD9/kJCb8lU2S4YJ/lBBXG/aqQvibGnFY3rLEW6d3HtqDH X-Received: by 2002:a05:6358:6f09:b0:168:e2d5:ddcc with SMTP id r9-20020a0563586f0900b00168e2d5ddccmr15806843rwn.7.1698744852545; Tue, 31 Oct 2023 02:34:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698744852; cv=none; d=google.com; s=arc-20160816; b=R4mxSucdoNbqpQ3681Lfhbonimshhxp9TG4OPXq22+SMY4O766Z+Yfh07IFrxG+kPS O76UzWjBlWR3/YC/mw0xUwyrX2RjE0OCCyGpWzfXpTbVZyYDb6P/2JgTI3N5tkuPGT+O m/6Hv4WDkV7WjPvTXOAMKCrQb2Kl6QF0RQ5nmTW8aNmHC2Cd5ZH2Z01WpjFuRzeMhhj/ IMTvB7PCrt0KxbZ/9qpCz35vIB8dcCWCjtKuRy5AN4ZgsWNdC6znTwEdlxuBp+95BUxG YqtkevxYdQ58JWGJYF6GnX3ilThbz5Zhmqqm+hmXtyZk20ODaT80ixZ7QdlhANUI0BlQ xPAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=m47EAzqConAoJeh9KR/8kdD9Cq9u7uQy035dBZUpv0w=; fh=2PlJp5uBKY8Po5DW+Y2+ipAzOJrwBBR1SjaiYcn+1dw=; b=MQJIq8FnUsXI4U+bbKpMnaYtQt43/EYB0CV5+rnS7N0k1iujj5EJUk/Ber85RxC9Jj JWbNWTfw01OE+t1zAI94Yr72Z3MTe2xXKJ2KDEeHXteAhn3NlK1/8KrfAVzA2UCnMO+a uHKxal2r7LJ+IxIGkp+VxzD4cJHour4tde+dcJ9q+P4XlLNaI900zQd9x+gkaDswQ0Y5 Lsw9D0+RPqj5fGvqyIeCvCz4dbxNrrRiNkerqTNwuOJcWNpie8UIUY6BzY4JV1zAr3KJ z/53jXSbvhzEZexhxDTL7e7U2MJbHqH38zlpUly9POHj/q5m8i1SO4WkyOLzg0S9ip9D od4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=IebiPiW3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id w64-20020a638243000000b005b91a58721esi788881pgd.316.2023.10.31.02.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 02:34:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=IebiPiW3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3108A8033370; Tue, 31 Oct 2023 02:34:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343933AbjJaJeA (ORCPT + 99 others); Tue, 31 Oct 2023 05:34:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343909AbjJaJd7 (ORCPT ); Tue, 31 Oct 2023 05:33:59 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83550B7; Tue, 31 Oct 2023 02:33:56 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3656CFF811; Tue, 31 Oct 2023 09:33:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1698744835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m47EAzqConAoJeh9KR/8kdD9Cq9u7uQy035dBZUpv0w=; b=IebiPiW3z5rimh+Cw3MRE44T90St+6GCGnlsEWuv9nDu7j9N1Jk1vLk/rKm4ZwbrMPI+oa 3HZEGlx9OkxMQQ6x+xH023VJ+B2ZqoXlXvR2sciWSgQ+Lpb796IKuQFnM4V3V0TUZy/OEW hg9PGSb5agMVpNh/iCSU+Nkx2TbpMmD3tJnVl2NercKUOcxCZPPgDKK+vILI97ZxDOdNPg fCA1nByp3nD2azf32qBrczImLlfa5pSqFD1510jVbpayaYS/h3EuvwQxSaYkEBPo/N1OT/ hJ81V9BmxU7EifbWYs8RF7ApeNi7pL1jTuXC3IcX0BlNawvjQZGjRFkZ5y8j8A== Date: Tue, 31 Oct 2023 10:33:52 +0100 From: Mehdi Djait To: Christophe JAILLET Cc: mchehab@kernel.org, heiko@sntech.de, hverkuil-cisco@xs4all.nl, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, conor+dt@kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, alexandre.belloni@bootlin.com, maxime.chevallier@bootlin.com, paul.kocialkowski@bootlin.com, michael.riesch@wolfvision.net Subject: Re: [PATCH v9 2/3] media: rockchip: Add a driver for Rockchip's camera interface Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-GND-Sasl: mehdi.djait@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 31 Oct 2023 02:34:10 -0700 (PDT) Hello Christophe, On Mon, Oct 30, 2023 at 01:47:17PM +0100, Christophe JAILLET wrote: > > + /* Create & register platform subdev. */ > > + ret = cif_register_stream_vdev(cif_dev); > > + if (ret < 0) > > + goto err_unreg_media_dev; > > + > > + ret = cif_subdev_notifier(cif_dev); > > + if (ret < 0) { > > + v4l2_err(&cif_dev->v4l2_dev, > > + "Failed to register subdev notifier(%d)\n", ret); > > + cif_unregister_stream_vdev(cif_dev); > > + goto err_unreg_media_dev; > > Should there be another label with cif_unregister_stream_vdev(cif_dev); if > an error occurs here? > > CJ cif_subdev_notifier() is the last function call in the probe with error handling. So it will undo the last successful register: cif_register_stream_vdev and use the goto to unregister the rest. I can add a label err_unreg_stream_vdev but it will be only used in the error handling of cif_subdev_notifier() and I don't see the benefit. -- Kind Regards Mehdi Djait > > + } > > + > > + cif_set_default_format(cif_dev); > > + pm_runtime_enable(&pdev->dev); > > + > > + return 0; > > + > > +err_unreg_media_dev: > > + media_device_unregister(&cif_dev->media_dev); > > +err_unreg_v4l2_dev: > > + v4l2_device_unregister(&cif_dev->v4l2_dev); > > + return ret; > > +}