Skip to contentSkip to conversation

tty: serdev: fix missing static modifier on DEVICE_ATTR_RO(modalias)

PATCH In review David Lechner 2 participants 4 messages Apr 27, 2018 – Apr 28, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: serdev: fix missing static modifier on DEVICE_ATTR_RO(modalias)

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 <[email protected]>
Cc Johan Hovold <[email protected]>
Cc Sebastian Reichel <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc <[email protected]> # 4.14.x

---

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(-)
drivers/tty/serdev/core.c +1 -1
index 97db76afced2..25298b7b2419 100644
@@ -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,
Signature · 1 line
2.17.0
#1 lore raw
Quoted 26 lines · David Lechner

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 <[email protected]>
Cc Johan Hovold <[email protected]>
Cc Sebastian Reichel <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc <[email protected]> # 4.14.x

---

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(-)
drivers/tty/serdev/core.c +0 -0
index 97db76afced2..25298b7b2419 100644

drivers/tty/serdev/core.c static ssize_t modalias_show(struct device *dev, · line 282

Quoted 8 lines
drivers/tty/serdev/core.c +1 -1
@@ -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,

This patch implies that there is also another "global" modalias variable somewhere in the system, right? Where is that one being defined?

And I do like to keep original commits for stable trees, but this one might be ok here, if we figure out what this is conflicting with.

thanks,

greg k-h

#2 lore raw
Quoted 33 lines · Greg Kroah-Hartman
Quoted 32 lines · David Lechner

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 <[email protected]>
Cc Johan Hovold <[email protected]>
Cc Sebastian Reichel <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc <[email protected]> # 4.14.x

---

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(-)
drivers/tty/serdev/core.c +1 -1
index 97db76afced2..25298b7b2419 100644
@@ -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);
 
Quoted 5 lines

drivers/tty/serdev/core.c static ssize_t modalias_show(struct device *dev, · line 282

Quoted 2 lines
drivers/tty/serdev/core.c +0 -0
  static struct attribute *serdev_device_attrs[] = {
  	&dev_attr_modalias.attr,

This patch implies that there is also another "global" modalias variable somewhere in the system, right? Where is that one being defined?

It is in an out-of-tree driver I am using.

Quoted 8 lines

And I do like to keep original commits for stable trees, but this one might be ok here, if we figure out what this is conflicting with.

thanks,

greg k-h

#3 lore raw
Quoted 39 lines · David Lechner
Quoted 22 lines · Greg Kroah-Hartman
Quoted 21 lines · David Lechner

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 <[email protected]>
Cc Johan Hovold <[email protected]>
Cc Sebastian Reichel <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc <[email protected]> # 4.14.x

---

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(-)
Quoted 15 lines

drivers/tty/serdev/core.c static ssize_t modalias_show(struct device *dev, · line 281

Quoted 12 lines
drivers/tty/serdev/core.c +1 -1
index 97db76afced2..25298b7b2419 100644
@@ -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,

This patch implies that there is also another "global" modalias variable somewhere in the system, right? Where is that one being defined?

Quoted 1 line

It is in an out-of-tree driver I am using.

Then please fix that obviously broken out-of-tree driver :)

good luck!

greg k-h