# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/linux/isapnp-uevent.patch # Copyright (C) 2024 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License version 2 as used by the T2 SDE. # --- T2-COPYRIGHT-NOTE-END --- We want our precious isapnp devices to just work TM and auto-load matching modules, too. - Signed-of-by: René Rebe --- linux-6.8/drivers/pnp/driver.c.vanilla 2024-03-14 11:37:26.907799981 +0100 +++ linux-6.8/drivers/pnp/driver.c 2024-03-14 11:44:07.479779804 +0100 @@ -150,6 +150,24 @@ drv->shutdown(pnp_dev); } +static int pnp_uevent(const struct device *dev, struct kobj_uevent_env *env) +{ + const struct pnp_dev *pnp_dev = to_pnp_dev(dev); + struct pnp_id *pos; + + if (!dev) + return -ENODEV; + + pos = pnp_dev->id; + while (pos) { + if (add_uevent_var(env, "MODALIAS=pnp:d%s", pos->id)) + return -ENOMEM; + pos = pos->next; + } + + return 0; +} + static int pnp_bus_match(struct device *dev, struct device_driver *drv) { struct pnp_dev *pnp_dev = to_pnp_dev(dev); @@ -259,6 +277,7 @@ const struct bus_type pnp_bus_type = { .name = "pnp", .match = pnp_bus_match, + .uevent = pnp_uevent, .probe = pnp_device_probe, .remove = pnp_device_remove, .shutdown = pnp_device_shutdown,