From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 0D70421322E for ; Thu, 13 Feb 2025 10:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739441431; cv=none; b=q+UhOuopVWmqPYfIQpjVQrly9W4fD4PES7m7Lu0nmF5ALaOHGdKV+Oc+FFf5b2zrhSQIrxTNuzT+S2DFJhwrUQj6suOwaih11g8Vqn6cftdHDCgTYEvwc9orAT5jqAOjFx/99JCmv/KYKUS6NF3XH45mHzIpfgHdofn0G6o+zKI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739441431; 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=EsSVENtnynjuClFfMvhPSj6k/L9W/ck47MlngiVtl0md+itr5vd40JJ2R9mZANlNfyS58Se+vYKNX1qTIP5DtGx+OM0csRn8saCcChXRzF/PO51D9jo7YEmB5Mpn3RezCZHsLm+CVJxvTclrvfCuQKi6QZRjEwDrbKcZOzDmIGs= 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.128.46 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-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4394829ef0fso11200375e9.0 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=JVXBk1ngEQ1zdGKg2/vZdu90m4khcvtQr71KeG4hvBzp3CcKYpKtwAd1hc9ASd3NRx JmYdAUsYcibTwTcML2kWm/guIUw/G+lJvDyxtGbSUYODZ//0WPX0MyXwTB7/B+6NvRsk vdl76ilIIkqoiissrvrCIiilazvZ7hB4lJ7aix3gCWEfZ58D2i7WpUdqJ0DIc4vvz0HV umlDELKkfOubq7S3Ifx0csJU6hMuuYyu2LmWaHJkdQ/ClaQ/h7zaaeJflomT5p2IcwPN vbOJU4tYBZbDtbT0jMiUjMaF8lw0kUDx/B2mXO080QfTjMrii/LQtCgmn2SZGEWK7JHH /Zsg== X-Forwarded-Encrypted: i=1; AJvYcCUcRoajqBQ7tFyWhbilBiG579/Igft3Fq9mYUba6G29adQjqhfRKpU93e46qccX3Y8SnTpo4cHF7iGGRJmZOrYo/jto@vger.kernel.org X-Gm-Message-State: AOJu0YzyhFlRvhe+TAcklRRYW7m916TONDEc3XuL9Gsyh9C1CQR744tP qzwdiWafIuyt+QUlnQkK3S6TNqAUYJNiZFdyJl5Wy+BVH+P3wH6l4X7u5HyfOE0= X-Gm-Gg: ASbGncuA2kMoTFufYRsCEOGtwVXwUvpcftNp07IUY8ovg25kU8IVOuZe9//Gyi/zzCE CVQ5DNvUGntJ0RcCWpNYXKmVSIv9o5+PvcVHs83qAkJ7BDwNrCjEQGzjey6Zg/5tIQvHq3y/ODL yPy+y6FuQSLp2G8oqn4E6qEFDphF1zXrsY0Ox9TeoppABbacNvqxk+0oeOY3r0L3HquUY4Li3ff 0vxGD0EUDLE96275/0HpxM4+OhLuCzqvO7JjC9KFVrkIZOmzG53Yt5uRZ/r6rjIBkM7BBsSde56 29pXvIALb/OS7w== 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: platform-driver-x86@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