[PNP] Export all aliases through the modalias attribute From: Pierre Ossman In order to be backwards compatible, we previously only exported the first of all the PNP module aliases. We should instead export all aliases, delimited by newlines. --- drivers/pnp/interface.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c index 67bd17c..8e78923 100644 --- a/drivers/pnp/interface.c +++ b/drivers/pnp/interface.c @@ -461,11 +461,15 @@ static DEVICE_ATTR(id,S_IRUGO,pnp_show_c static ssize_t pnp_modalias_show(struct device *dmdev, struct device_attribute *attr, char *buf) { + char *str = buf; struct pnp_dev *dev = to_pnp_dev(dmdev); struct pnp_id * pos = dev->id; - /* FIXME: modalias can only do one alias */ - return sprintf(buf, "pnp:d%s\n", pos->id); + while (pos) { + str += sprintf(str,"pnp:d%s\n", pos->id); + pos = pos->next; + } + return (str - buf); } static DEVICE_ATTR(modalias,S_IRUGO,pnp_modalias_show,NULL);