Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1962511lqg; Mon, 4 Mar 2024 08:47:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUtnD1ZWC04qqa6BvISGDMtZzLA591GiWenbW4yOTINiVFgdoPez2RUw5fus14vaxWgGLr40nTZ+bewQ+er9I4I55gbAsam7wtIbTQTvg== X-Google-Smtp-Source: AGHT+IGJKQyRRcs4rYQMZV/OCwgADO3D38M4qcFrYwTu5OitVc2ymnkHA2C38uisAbxDJW+pzmJn X-Received: by 2002:a05:6402:70d:b0:566:ab45:e6ca with SMTP id w13-20020a056402070d00b00566ab45e6camr7026527edx.39.1709570825308; Mon, 04 Mar 2024 08:47:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709570825; cv=pass; d=google.com; s=arc-20160816; b=L598GYL4kHuj5c3rxqV9nF1RbmIDtsZLtRynwD7WQbIexnt729jE5XhKxITfPRp0wi QPHmCF6fF3oYniBXgQxM2Qt9FrVMCLRhzCTk1cYID/tVrmfE2n5QpODNlzZeidYOqBlM v9KLYXpQwTzEEa5DgVWpAU3g2/ppNi3vUIB9QSBDFjCo+616QmZw8zR5lrw6KArmIZ8H I8b8cYXMAcLFDuhhPI+zhM5IcP8mMnv/hK1MZ0MsynmdU5atPuk67u7Suzjm/cWqg2bJ 9TLlE1Nek0ZGUNWCdH4JAr8fLHAmiLLCIDYHG20GRrG3D/eU0v38vvVrGO/j2O8t02dL 4tDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DPf1kYFPg3DUPGE7Ih6xP5Me/yZuHQEqY1LCOwSuLQo=; fh=1jiRGodec41DZVisOe7vqpZwDX2lVoC85nfph4c5VTM=; b=jMU8l/+fbcL0AyJHBmoow9MG29U/XYgyAnPfvecfQ+cMD9sfyu17+cyPx5I1PKrmkD ue/qXe3gYSNlg9ETUfP8x97zh16wonovrPZF9llpqY/LMVQwKyy4b9eCZrLOHCwVmYu2 ciTFVPoaqIy8sIVIJG/D03rSJMTDDEp3tjGkdC1h91KwyzNI7eqtG8CKAz6Xabpkyy65 O09e8lXLdkiPTf7i61vYgpbCJj+5w9fdviSNkcD9rZgLFZ9X+JaNDgOmNuyRehiwvWmD sU+djIuw/SPm0AlFt7w34LouUa6xaWWxIpG4lmc28C9Wn6A5msEbryOf8KLKWVJ/X7q1 4iGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CR2tb1cA; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-90456-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90456-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dg16-20020a0564021d1000b005647dac6af5si4194049edb.312.2024.03.04.08.47.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 08:47:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90456-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CR2tb1cA; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-90456-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90456-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B19F61F23F50 for ; Mon, 4 Mar 2024 10:49:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06DE1383B4; Mon, 4 Mar 2024 10:48:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="CR2tb1cA" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0C9F374DE; Mon, 4 Mar 2024 10:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709549335; cv=none; b=adWvqNIA7QTUIb8Z93mfKYxQhFk98+N1WgPzTiKxQP60QCUICLEbS10ebjweAHYSKyYFddlhE8pQ6WMfo9bCoJp59w51l4Kww+tRQw9rPBZUQHPsyxICPI9gdpMpPxbRPAm0Fm2DcRSR6SkRirhs/EFX7pVpvhrjVkOTn/pQfrQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709549335; c=relaxed/simple; bh=OE0XZMxoN+lzBJ6Pub/O4OVZnEDZz5AZoPrtdE7dITo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=h9vNbz9tw4CdUqsyvbr21AiHqRRu2Idphux0VWNmDP/KI8G8FIv1mwaHKjhj1KehAqWzSCG1T+6qiTKonROcSjVgAVQE3nHKRufKEUreVUf30JuwNOlOQRIFU2oxUpweJN/UT+QMzrml7cn6oKYgUGMMpg2VpXB+tkRBS8arzGY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=CR2tb1cA; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709549332; x=1741085332; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=OE0XZMxoN+lzBJ6Pub/O4OVZnEDZz5AZoPrtdE7dITo=; b=CR2tb1cA+TraR8LCqREED7ChrsBO29hi/r9+SDXalwINVKgbx37bx9cQ YUsvokWxwy8r/eqVVVF1PfQP4IO03aF58p/yPUCpUa5kEZV4bv0B5ZHfH LdklePH5kLEHh8LVkb7vSonjGcSp+LxJYH53yNZGxmW1i6ZTrNuP6QGGM v5eY5bKEP38A9Sgvifg8e+qTSlK8w0xWHY/PwZmMT2RghWqHBD5vh5zJZ LIP9kbFyJR9nBFJ8bL6RHH4oUcJDy8kNHBwYxPRt44av1cqn32oxz6Fk9 n2I9EtwXqtm3uNx6oX4tOveSt2iqvzJJH/ghugOgrKxNNPqSKI9FxC778 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11002"; a="4197661" X-IronPort-AV: E=Sophos;i="6.06,203,1705392000"; d="scan'208";a="4197661" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2024 02:48:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,203,1705392000"; d="scan'208";a="46470235" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2024 02:48:51 -0800 Received: from kekkonen.localdomain (localhost [127.0.0.1]) by kekkonen.fi.intel.com (Postfix) with SMTP id 9C6C911F8B1; Mon, 4 Mar 2024 12:48:47 +0200 (EET) Date: Mon, 4 Mar 2024 10:48:47 +0000 From: Sakari Ailus To: Dan Carpenter Cc: Geert Uytterhoeven , Markus Elfring , linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org, Mauro Carvalho Chehab , Niklas =?iso-8859-1?Q?S=F6derlund?= , LKML Subject: Re: [PATCH] media: rcar-csi2: Use common error handling code in rcsi2_parse_dt() Message-ID: References: <8b4203dc-bc0a-4c00-8862-e2d0ed6e346b@web.de> <260d82b6-e7fc-40c3-b414-50a883709fd7@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <260d82b6-e7fc-40c3-b414-50a883709fd7@moroto.mountain> Hi Dan, On Fri, Mar 01, 2024 at 04:42:01PM +0300, Dan Carpenter wrote: > Sakari Ailus pointed out in another thread that we could use __free() > instead. Something like this: > Looks good to me. We could merge this with your SoB (pending Niklas's review). :-) The driver has been since moved under drivers/media/platform/renesas/rcar-vin/ . > diff --git a/drivers/media/platform/renesas/rcar-csi2.c b/drivers/media/platform/renesas/rcar-csi2.c > index 582d5e35db0e..c569df6057b7 100644 > --- a/drivers/media/platform/renesas/rcar-csi2.c > +++ b/drivers/media/platform/renesas/rcar-csi2.c > @@ -1372,8 +1372,8 @@ static int rcsi2_parse_v4l2(struct rcar_csi2 *priv, > static int rcsi2_parse_dt(struct rcar_csi2 *priv) > { > struct v4l2_async_connection *asc; > - struct fwnode_handle *fwnode; > - struct fwnode_handle *ep; > + struct fwnode_handle *fwnode __free(fwnode_handle) = NULL; > + struct fwnode_handle *ep __free(fwnode_handle); > struct v4l2_fwnode_endpoint v4l2_ep = { > .bus_type = V4L2_MBUS_UNKNOWN, > }; > @@ -1388,18 +1388,14 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv) > ret = v4l2_fwnode_endpoint_parse(ep, &v4l2_ep); > if (ret) { > dev_err(priv->dev, "Could not parse v4l2 endpoint\n"); > - fwnode_handle_put(ep); > return -EINVAL; > } > > ret = rcsi2_parse_v4l2(priv, &v4l2_ep); > - if (ret) { > - fwnode_handle_put(ep); > + if (ret) > return ret; > - } > > fwnode = fwnode_graph_get_remote_endpoint(ep); > - fwnode_handle_put(ep); > > dev_dbg(priv->dev, "Found '%pOF'\n", to_of_node(fwnode)); > > @@ -1408,7 +1404,6 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv) > > asc = v4l2_async_nf_add_fwnode(&priv->notifier, fwnode, > struct v4l2_async_connection); > - fwnode_handle_put(fwnode); > if (IS_ERR(asc)) > return PTR_ERR(asc); > > -- Regards, Sakari Ailus