From nobody Mon Feb 9 16:50:42 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 1FC742FD66F; Tue, 21 Oct 2025 16:33:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064414; cv=none; b=jSB04AjxNybY34cMxt568Mi8miFhZqTOYrAYa3oGsAr32uJ7IIKty04cEsGtHjwIuCyO0R0wviOTNkQt/8fbUiTVFdOi6QswpjX9eHSgmUme6kjNupD9LsgesbBOYsoPoGVBkdOP8hyqIViVT9SUUzD5SAx7r+067a+JnydDtos= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064414; c=relaxed/simple; bh=sir3J4gSwhHTRdJ1BAz2vNiZTw6r2T/fSmbbEzzZvdM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AEib3EZnguKrv+G8xxBjbJxBR2KbxeigxyQK64Q/dkpkhHNYXQGoTSSUpKXS7ZYs/fzg6deI8T3zQf8ferYPJk6DBuX7UQe9J5MrPJ9ydYoytPiUOn3nv6QcusGR5o5QMhznCy50G9MK9jH9iDg67B4AjmvcDkW5MAOsZ3aibcU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=xX8WnMrx; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="xX8WnMrx" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 14E95C0B896; Tue, 21 Oct 2025 16:33:11 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id A25CE60680; Tue, 21 Oct 2025 16:33:30 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6E84C102F241F; Tue, 21 Oct 2025 18:33:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761064409; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=M7/ONsHb0ArB5bCF7FZGbfdHV5WjqY9DA/Z65CQxU0E=; b=xX8WnMrxi/X88u7Eg5zoCx9CHz5yL2wsY3l/KUe00x1hEU7zWZkmpabCMmV8Yxh3IM23Oi eGw5pf4isLqxz61epTfXCZ3AfuiPiFx1qz9RWgfyzi5ES3PqoJsX6K0LRNBnBgzGKCL04d c7eKbBQmgwH1iHUSY8J1nHKhNVZwAb5GOmH+2ZP7Jy+RpJVM8eAeSKs9YSrrCJBhBClaq6 n64tR7E6vUqVcEVzvhv5jDfNIG0pLejBn+MsUcadzor24P74zxio0nNPvu/RIM14+SWhR2 VHomIvVcLdGL9VRt5g7DmT+KGiRbOPM4TmFOsntz40A4ExclfTIcCVnSF50dOw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Tue, 21 Oct 2025 18:32:49 +0200 Subject: [PATCH net-next 08/12] clk: eyeq: use the auxiliary device creation helper 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251021-macb-eyeq5-v1-8-3b0b5a9d2f85@bootlin.com> References: <20251021-macb-eyeq5-v1-0-3b0b5a9d2f85@bootlin.com> In-Reply-To: <20251021-macb-eyeq5-v1-0-3b0b5a9d2f85@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Vladimir Kondratiev , =?utf-8?q?Gr=C3=A9gory_Clement?= , Russell King , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Thomas Bogendoerfer , Philipp Zabel Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org, Tawfik Bayouk , Thomas Petazzoni , =?utf-8?q?Beno=C3=AEt_Monin?= , Maxime Chevallier , =?utf-8?q?Th=C3=A9o_Lebrun?= , Jerome Brunet X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 From: Jerome Brunet 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. Tested-by: Th=C3=A9o Lebrun # On Mobileye EyeQ5 Signed-off-by: Jerome Brunet --- drivers/clk/clk-eyeq.c | 57 +++++++++++-----------------------------------= ---- 1 file changed, 12 insertions(+), 45 deletions(-) diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c index ea1c3d78e7cd..664ce7d7868d 100644 --- a/drivers/clk/clk-eyeq.c +++ b/drivers/clk/clk-eyeq.c @@ -322,38 +322,18 @@ static void eqc_probe_init_fixed_factors(struct devic= e *dev, } } =20 -static void eqc_auxdev_release(struct device *dev) -{ - struct auxiliary_device *adev =3D to_auxiliary_dev(dev); - - kfree(adev); -} - -static int eqc_auxdev_create(struct device *dev, void __iomem *base, - const char *name, u32 id) +static void eqc_auxdev_create_optional(struct device *dev, void __iomem *b= ase, + const char *name) { struct auxiliary_device *adev; - int ret; =20 - adev =3D kzalloc(sizeof(*adev), GFP_KERNEL); - if (!adev) - return -ENOMEM; - - adev->name =3D name; - adev->dev.parent =3D dev; - adev->dev.platform_data =3D (void __force *)base; - adev->dev.release =3D eqc_auxdev_release; - adev->id =3D id; - - ret =3D auxiliary_device_init(adev); - if (ret) - return ret; - - ret =3D auxiliary_device_add(adev); - if (ret) - auxiliary_device_uninit(adev); - - return ret; + if (name) { + adev =3D devm_auxiliary_device_create(dev, name, + (void __force *)base); + if (!adev) + dev_warn(dev, "failed creating auxiliary device %s.%s\n", + KBUILD_MODNAME, name); + } } =20 static int eqc_probe(struct platform_device *pdev) @@ -365,7 +345,6 @@ static int eqc_probe(struct platform_device *pdev) unsigned int i, clk_count; struct resource *res; void __iomem *base; - int ret; =20 data =3D device_get_match_data(dev); if (!data) @@ -379,21 +358,9 @@ static int eqc_probe(struct platform_device *pdev) if (!base) return -ENOMEM; =20 - /* Init optional reset auxiliary device. */ - if (data->reset_auxdev_name) { - ret =3D eqc_auxdev_create(dev, base, data->reset_auxdev_name, 0); - if (ret) - dev_warn(dev, "failed creating auxiliary device %s.%s: %d\n", - KBUILD_MODNAME, data->reset_auxdev_name, ret); - } - - /* Init optional pinctrl auxiliary device. */ - if (data->pinctrl_auxdev_name) { - ret =3D eqc_auxdev_create(dev, base, data->pinctrl_auxdev_name, 0); - if (ret) - dev_warn(dev, "failed creating auxiliary device %s.%s: %d\n", - KBUILD_MODNAME, data->pinctrl_auxdev_name, ret); - } + /* Init optional auxiliary devices. */ + eqc_auxdev_create_optional(dev, base, data->reset_auxdev_name); + eqc_auxdev_create_optional(dev, base, data->pinctrl_auxdev_name); =20 if (data->pll_count + data->div_count + data->fixed_factor_count =3D=3D 0) return 0; /* Zero clocks, we are done. */ --=20 2.51.1