Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp124383rdb; Tue, 31 Oct 2023 02:47:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzRoODflDisZfOnzMwdDNbHglZXQEDUk1+eRiC/XwSUxk9OEiLjv3FvqSzuwR6v7PJdTRR X-Received: by 2002:a17:90b:158:b0:280:3b05:3081 with SMTP id em24-20020a17090b015800b002803b053081mr5143208pjb.37.1698745626708; Tue, 31 Oct 2023 02:47:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698745626; cv=none; d=google.com; s=arc-20160816; b=iTE7vzqLYvWDCu45wbL9r+7WqpOXJ1xK7Tgzpy/Nla4npiOxq/C13VA+gYkbQw6IQZ sDGkiGrUuQng4zh8CkVgULdLY4cBTCEY+aFj/s51jzGkCP6dIY3XcjqMYLTVqMXT0BXA Vtdl7OgFOynYtbLwp41tGD0c5epUxzTAgonPXckr/o6WKctCadCjxcpzq2YerXHj49Eh sR3vUNuxDW/AtI9fX+cn6yGa3Efl6iS+9OAEXGP6nDmVRQSvzBjO1R5YFSJxh3r6MKnT iSgw9p5MyzGH13Ewb9D4Q8UnK0TUIWA4pYooSElT6KqiLXy5rQD8gTid2BhToSjXuCHe G1HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=zSJ2fHyj4ub3HQ+xTvg2C+89BzyjfVFV9HNzabEf0Ow=; fh=pAi/LaEwKMQi3Y+96V0/fhG51aDDqck8dkm5Me6folc=; b=F9tA6WPW6bLY1J5kAWs4XPSypK7b/xNVPR7SOvv3KhkFoMKZV/q5HBNMqKOUc/4dec 8vq6b0nTI5LGdsg5iiE65VZzQEzCq6V6yqBPnKoITABoZbensOl2hZsCnXNeJqH7hKZg NAZTP43nMUJjyPNcbInzLFFFfH99+h8n9djE36VhhNt9XDWkXVceJrqJkG5jcTYpzV/3 B/dVZ5HCLFoY+eo+Tv2M6sVKVTzCAuF8gvS83N8TDiyWNcNYebnulWshfH0GO2EnYHx1 OjDBicN33F2IbiNL2deww5ooEulqG40b/4sCj+F2a/LGOEtxLyzcITTOQR6mKfn5eEjc l5OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=pItzdUQ1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id rj11-20020a17090b3e8b00b002808ca78d11si741482pjb.52.2023.10.31.02.47.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 02:47:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=pItzdUQ1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id AF1DA80267F5; Tue, 31 Oct 2023 02:47:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbjJaJrD (ORCPT + 99 others); Tue, 31 Oct 2023 05:47:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjJaJrB (ORCPT ); Tue, 31 Oct 2023 05:47:01 -0400 Received: from smtp.smtpout.orange.fr (smtp-22.smtpout.orange.fr [80.12.242.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C7A4DA for ; Tue, 31 Oct 2023 02:46:57 -0700 (PDT) Received: from [192.168.1.18] ([86.243.2.178]) by smtp.orange.fr with ESMTPA id xlKmq2Nre68frxlKnqKvCp; Tue, 31 Oct 2023 10:46:54 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1698745614; bh=zSJ2fHyj4ub3HQ+xTvg2C+89BzyjfVFV9HNzabEf0Ow=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=pItzdUQ1tmeLPjEvh9MNVJD8b0CkSTjpqFevmmeUzr30hh8dnRYaJY4mjDCPLYLG0 wB2Hj8zoRvx96zrr5HdERAcjlChmfOSDKzYnofh3BIls0h8ocW/EYgqHMWyS/+v3Iu vunddG/NBhfTpkB64eWkI2rK6HNnPaQboOhJ5/gvoO82lJZ6FWwZ9EyzT3IkFml/JW riuMjV0hukAld3YpQAuCvmMKKWTen3KQQQHJ3gWeE8LwbvzKrbn9fn6T/yIcJM955/ eMXN14wiaAZZ2Xr08ZTqXuT09NbrcdS3TadbLHctg82XTRV+lX8Go1DKh+pUxE3uwP /33clZvCJMJfw== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 31 Oct 2023 10:46:54 +0100 X-ME-IP: 86.243.2.178 Message-ID: <79231ec3-8da1-4c73-8f5b-efa445e6c35d@wanadoo.fr> Date: Tue, 31 Oct 2023 10:46:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9 2/3] media: rockchip: Add a driver for Rockchip's camera interface Content-Language: fr, en-GB To: Mehdi Djait 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 References: From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 31 Oct 2023 02:47:05 -0700 (PDT) Le 31/10/2023 à 10:33, Mehdi Djait a écrit : > 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. Ah, I didn't see the cif_unregister_stream_vdev() call here. Sorry for the noise. > > 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. The main benefit is to be more consistent in the way the error path is written, and to be more future proof. CJ > > -- > 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; >>> +} >