From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F0A321324D for ; Thu, 13 Feb 2025 10:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739441430; cv=none; b=VaaP81HLFZjKe/4G6ua+5TAmCtMafJBpTIMf4ATWGUCjmx24EhQ4uBaidqY5Scf4f+BXwjdWtQ/Kv7bJfmV7Hh7AMyPgDKpDmkXqboX1KdFfUYvP13cWna/0V6jYwbl0prlh7SYoywecasRp09ZrtlBupQoaMmLZz9eglz3ndYY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739441430; c=relaxed/simple; bh=bzt6k+aa5u1/W7RojxBuWDr/44deao41NZx9GmrqMJM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=LXjcPfD0H6AXPgN/DEavI+Ob75BzC40GytWLIMzIyYsNFo19fhuV4g0OqX05erQLRA+99saH5p/+LS0PrrT3bpeihl+9lEThwVsXHum67ncoOwNnaIU5ygrtrfx0I95mYh03zBmPWDyW0iBQCB8yqjoNb7L5sacPtRofuBronzA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=DWV/mKp6; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="DWV/mKp6" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-38ddc36b81dso385118f8f.1 for ; Thu, 13 Feb 2025 02:10:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1739441426; x=1740046226; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Cb9z6DcnNl0g9HoZcHoRWOLXyD9UxXMHyf9eNtzv3So=; b=DWV/mKp63pxV+LA8XqcAjES7sNx/RxS5s2nhyBO4QxSxHMSa+Bws8aXeY20e5icFSk 6sYVUPP70NmjzUHLrPqPIreJ7Doe2aoAHvCGFX/HMBp4FrtiT0iOSHtBSml1Vx+HAS7S i4np6BhStsjGRt7Sdbx98cHWw61wAg3VrbHRTX4X6KFuiPjqZkDUwX7FI+PGOL+fRtTj swzf5oWzp8FkXzqonBgJYo6SLy2DU+g+grnVV9s9D076X7KsL2ePlkuJS9+crlnxoYB6 iGb/w+TnuulCh4hF+8zxCalza/M/n6Gw8Ft+GVFjTNn8bp2h11oUrZqJv2UyLifZtVZS WkPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739441426; x=1740046226; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Cb9z6DcnNl0g9HoZcHoRWOLXyD9UxXMHyf9eNtzv3So=; b=j5KZbCuhdDrM/Gh6SukXZV1BvBaCgiAtJdLCET+53Iw1Iwcoh6jKP5hiKg7O9eaHf3 +XU/cXRO1UtvX1QvXKRGp7fC6e7WoNqgPbPGxXBNb3OG7mEQTGlwOzAakpHuXVNg4Jil dOg6lh5LfmAYwzRiECIYGoVulj5if/bESII4azXV0b6si7LZR6IzIrKzTDN6tLJT/kuH RdK5Q89qVLOec1j3JjAOA3dHZDAyyyqB6XjFTiHjwm5Cugv42HpQKSR49yKN4R33FKJS MOg3lgsUBw22dUklf1RotYkRtJqkfo0JVp8jI+1/dN2g5cVUoMgFtmIgXyugbB1zgc+t 5anw== X-Forwarded-Encrypted: i=1; AJvYcCXpSiuj4NfRAoaUKvJiIhwkxG7KTAY125PDLbdpvZVxQmh7oA+sct15FAYWIOP1M5VfXPu/PVWyApM=@vger.kernel.org X-Gm-Message-State: AOJu0Yxfh+ShSFZpZSfLyCZA5gaPU9Kt4rLiFfFNDtXPOVSqW39Mhh0x cPUXe2ktPb4wTu0g1KOK9qrzlWCZYIM9Gk8wg5zzj8VyhCNWTYiV2c4RCJsL1ls= X-Gm-Gg: ASbGnct3+gP3/KYT7Il1sCWPZroCKLvbQXpglRF95eEUdYmN+P1PApXVvGOtBlOAdbq LXGq/GYrcZVsjs5kX3FNDKYN0mV60htypcECSCsuOZDaTsWCHXClRAsivAF0fxgiUrdmD+RaLP8 FifiC4VPrHJRL0Di2nzEJ+3B0hw0YW2fgEn2glrKLgbrlRA3T2kKs5YKWsHxfi8voYh8Is8uKnP LQIYj2PsCKdrG5tfqz6vuzBYGeiZUIW34wTqJA8FztIA6PziyNnMeF2EpXW9HEMx7pz+Exugqky MVVxVoZjRu5dIg== X-Google-Smtp-Source: AGHT+IFnAzzmsoX/LnTlYKfUwdNafAjQwt9ZvkB3qt0FKjzX4kx3PyzgxFabDyvJ+Y073z4cgUVqUg== X-Received: by 2002:a5d:648b:0:b0:386:3327:4f21 with SMTP id ffacd0b85a97d-38f24f9cc70mr1962954f8f.27.1739441426065; Thu, 13 Feb 2025 02:10:26 -0800 (PST) Received: from localhost ([2a01:e0a:3c5:5fb1:b617:2c1:fc8c:2705]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f259d5c36sm1435555f8f.67.2025.02.13.02.10.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2025 02:10:25 -0800 (PST) From: Jerome Brunet To: Doug Anderson Cc: Greg Kroah-Hartman , Dave Ertman , Ira Weiny , "Rafael J. Wysocki" , Stephen Boyd , Arnd Bergmann , Danilo Krummrich , Conor Dooley , Daire McNamara , Philipp Zabel , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Hans de Goede , Ilpo =?utf-8?Q?J=C3=A4rvinen?= , "Bryan O'Donoghue" , Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?Q?Th=C3=A9o?= Lebrun , Michael Turquette , Abel Vesa , Peng Fan , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Kevin Hilman , Martin Blumenstingl , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, linux-mips@vger.kernel.org, linux-clk@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Subject: Re: [PATCH v3 3/7] drm/bridge: ti-sn65dsi86: use the auxiliary device creation helper In-Reply-To: (Doug Anderson's message of "Wed, 12 Feb 2025 08:38:25 -0800") References: <20250211-aux-device-create-helper-v3-0-7edb50524909@baylibre.com> <20250211-aux-device-create-helper-v3-3-7edb50524909@baylibre.com> User-Agent: mu4e 1.12.8; emacs 29.4 Date: Thu, 13 Feb 2025 11:10:24 +0100 Message-ID: <1jfrki17fz.fsf@starbuckisacylon.baylibre.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed 12 Feb 2025 at 08:38, Doug Anderson wrote: > Hi, > > On Tue, Feb 11, 2025 at 9:28=E2=80=AFAM Jerome Brunet wrote: >> >> The auxiliary device creation of this driver is simple enough to >> use the available auxiliary device creation helper. >> >> Use it and remove some boilerplate code. >> >> Signed-off-by: Jerome Brunet >> --- >> drivers/gpu/drm/bridge/ti-sn65dsi86.c | 84 +++++++++-------------------= ------- >> 1 file changed, 20 insertions(+), 64 deletions(-) > > Thanks for creating the helpers and getting rid of some boilerplate! > This conflicts with commit 574f5ee2c85a ("drm/bridge: ti-sn65dsi86: > Fix multiple instances") which is in drm-next, though. Please resolve. Noted. this is based on v6.14-rc1 ATM > > Since nothing here is urgent, I would assume patch #1 would land and > then we'd just wait until it made it to mainline before landing the > other patches in their respective trees? That would simplest way to handle it I think. No rush. I'll rebase when the time comes. > > >> -static int ti_sn65dsi86_add_aux_device(struct ti_sn65dsi86 *pdata, >> - struct auxiliary_device **aux_out, >> - const char *name) >> -{ >> - struct device *dev =3D pdata->dev; >> - struct auxiliary_device *aux; >> - int ret; >> - >> - aux =3D kzalloc(sizeof(*aux), GFP_KERNEL); >> - if (!aux) >> - return -ENOMEM; >> - >> - aux->name =3D name; >> - aux->dev.parent =3D dev; >> - aux->dev.release =3D ti_sn65dsi86_aux_device_release; >> - device_set_of_node_from_dev(&aux->dev, dev); >> - ret =3D auxiliary_device_init(aux); >> - if (ret) { >> - kfree(aux); >> - return ret; >> - } >> - ret =3D devm_add_action_or_reset(dev, ti_sn65dsi86_uninit_aux, a= ux); >> - if (ret) >> - return ret; >> - >> - ret =3D auxiliary_device_add(aux); >> - if (ret) >> - return ret; >> - ret =3D devm_add_action_or_reset(dev, ti_sn65dsi86_delete_aux, a= ux); >> - if (!ret) >> - *aux_out =3D aux; > > I notice that your new code has one fewer devm_add_action_or_reset() > than the code here which you're replacing. That means it needs to call > "uninit" explicitly in one extra place. ... but it needs one memory allocation less ;) > It still seems clean enough, > though, so I don't have any real objections to the way you're doing it > there. ;-) Both ways are valid indeed. Just a matter of personal taste I guess. > > -Doug --=20 Jerome