lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260110-pci-m2-e-v3-8-4faee7d0d5ae@oss.qualcomm.com>
Date: Sat, 10 Jan 2026 12:26:26 +0530
From: Manivannan Sadhasivam via B4 Relay <devnull+manivannan.sadhasivam.oss.qualcomm.com@...nel.org>
To: Rob Herring <robh@...nel.org>, 
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
 Jiri Slaby <jirislaby@...nel.org>, Nathan Chancellor <nathan@...nel.org>, 
 Nicolas Schier <nicolas.schier@...ux.dev>, Hans de Goede <hansg@...nel.org>, 
 Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>, 
 Mark Pearson <mpearson-lenovo@...ebb.ca>, 
 "Derek J. Clark" <derekjohn.clark@...il.com>, 
 Manivannan Sadhasivam <mani@...nel.org>, 
 Krzysztof Kozlowski <krzk+dt@...nel.org>, 
 Conor Dooley <conor+dt@...nel.org>, Marcel Holtmann <marcel@...tmann.org>, 
 Luiz Augusto von Dentz <luiz.dentz@...il.com>, 
 Bartosz Golaszewski <brgl@...ev.pl>, 
 Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, 
 Daniel Scally <djrscally@...il.com>, 
 Heikki Krogerus <heikki.krogerus@...ux.intel.com>, 
 Sakari Ailus <sakari.ailus@...ux.intel.com>, 
 "Rafael J. Wysocki" <rafael@...nel.org>, Danilo Krummrich <dakr@...nel.org>, 
 Bartosz Golaszewski <brgl@...nel.org>
Cc: linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org, 
 linux-kbuild@...r.kernel.org, platform-driver-x86@...r.kernel.org, 
 linux-pci@...r.kernel.org, devicetree@...r.kernel.org, 
 linux-arm-msm@...r.kernel.org, linux-bluetooth@...r.kernel.org, 
 linux-pm@...r.kernel.org, Stephan Gerhold <stephan.gerhold@...aro.org>, 
 Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>, 
 linux-acpi@...r.kernel.org, 
 Manivannan Sadhasivam <manivannan.sadhasivam@....qualcomm.com>
Subject: [PATCH v3 08/14] serdev: Add support for swnode based driver
 matching and uevent/modalias

From: Manivannan Sadhasivam <manivannan.sadhasivam@....qualcomm.com>

Serdev devices that do not use OF or ACPI can use swnode to expose the
device specific properties that could be used to match the serdev driver.
For such devices, provide the swnode based driver matching and
uevent/modalias support.

If a serdev device doesn't support neither OF, nor ACPI, swnode will be
tried as a last resort.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@....qualcomm.com>
---
 drivers/tty/serdev/core.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index f8093b606dda..9d42bd5f550a 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -35,7 +35,11 @@ static ssize_t modalias_show(struct device *dev,
 	if (len != -ENODEV)
 		return len;
 
-	return of_device_modalias(dev, buf, PAGE_SIZE);
+	len = of_device_modalias(dev, buf, PAGE_SIZE);
+	if (len != -ENODEV)
+		return len;
+
+	return software_node_device_modalias(dev, buf, PAGE_SIZE);
 }
 static DEVICE_ATTR_RO(modalias);
 
@@ -49,13 +53,15 @@ static int serdev_device_uevent(const struct device *dev, struct kobj_uevent_env
 {
 	int rc;
 
-	/* TODO: platform modalias */
-
 	rc = acpi_device_uevent_modalias(dev, env);
 	if (rc != -ENODEV)
 		return rc;
 
-	return of_device_uevent_modalias(dev, env);
+	rc = of_device_uevent_modalias(dev, env);
+	if (rc != -ENODEV)
+		return rc;
+
+	return software_node_device_uevent(dev, env);
 }
 
 static void serdev_device_release(struct device *dev)
@@ -91,11 +97,13 @@ static int serdev_device_match(struct device *dev, const struct device_driver *d
 	if (!is_serdev_device(dev))
 		return 0;
 
-	/* TODO: platform matching */
 	if (acpi_driver_match_device(dev, drv))
 		return 1;
 
-	return of_driver_match_device(dev, drv);
+	if (of_driver_match_device(dev, drv))
+		return 1;
+
+	return software_node_match_device(dev, drv);
 }
 
 /**

-- 
2.48.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ