This fixes the compile error "multiple definition of `dev_attr_modalias'" by adding the static modifier to DEVICE_ATTR_RO(modalias). This change was made in the mainline kernel in 2460942f51f1 ("serdev: do not generate modaliases for controllers") along with some other changes. Fixes: 4fe99816a1ab ("tty: serdev: use dev_groups and not dev_attrs for bus_type") Cc: Hans de Goede <hdegoede@xxxxxxxxxx> Cc: Johan Hovold <johan@xxxxxxxxxx> Cc: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> # 4.14.x Signed-off-by: David Lechner <david@xxxxxxxxxxxxxx> --- Should we pick up the patch 2460942f51f1 ("serdev: do not generate modaliases for controllers") for stable or is this patch good enough? drivers/tty/serdev/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index 97db76afced2..25298b7b2419 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -276,7 +276,7 @@ static ssize_t modalias_show(struct device *dev, { return of_device_modalias(dev, buf, PAGE_SIZE); } -DEVICE_ATTR_RO(modalias); +static DEVICE_ATTR_RO(modalias); static struct attribute *serdev_device_attrs[] = { &dev_attr_modalias.attr, -- 2.17.0