Skip to contentSkip to conversation

rpmsg: Correct support for MODULE_DEVICE_TABLE()

PATCH In review Andrew F. Davis 2 participants 3 messages Apr 21, 2018 – Apr 23, 2018 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpmsg: Correct support for MODULE_DEVICE_TABLE()

Due to missing a missing entry in file2alias.c MODULE_DEVICE_TABLE() are not generating the proper module aliases. Add the needed entry here.

Fixes bcabbccabffe ("rpmsg: add virtio-based remote processor messaging bus")
---
 scripts/mod/devicetable-offsets.c |  3 +++
 scripts/mod/file2alias.c          | 11 +++++++++++
 2 files changed, 14 insertions(+)
scripts/mod/devicetable-offsets.c +3 -0
index 9fad6afe4c41..6667f7b491d6 100644
@@ -139,6 +139,9 @@ int main(void)
 	DEVID(hv_vmbus_device_id);
 	DEVID_FIELD(hv_vmbus_device_id, guid);
 
+	DEVID(rpmsg_device_id);
+	DEVID_FIELD(rpmsg_device_id, name);
+
 	DEVID(i2c_device_id);
 	DEVID_FIELD(i2c_device_id, name);
 
scripts/mod/file2alias.c +11 -0
index b9beeaa4695b..52fd54a8fe39 100644
@@ -944,6 +944,17 @@ static int do_vmbus_entry(const char *filename, void *symval,
 }
 ADD_TO_DEVTABLE("vmbus", hv_vmbus_device_id, do_vmbus_entry);
 
+/* Looks like: rpmsg:S */
+static int do_rpmsg_entry(const char *filename, void *symval,
+			  char *alias)
+{
+	DEF_FIELD_ADDR(symval, rpmsg_device_id, name);
+	sprintf(alias, RPMSG_DEVICE_MODALIAS_FMT, *name);
+
+	return 1;
+}
+ADD_TO_DEVTABLE("rpmsg", rpmsg_device_id, do_rpmsg_entry);
+
 /* Looks like: i2c:S */
 static int do_i2c_entry(const char *filename, void *symval,
 			char *alias)
Signature · 1 line
2.17.0
#1 lore raw
Quoted 15 lines · Andrew F. Davis

Due to missing a missing entry in file2alias.c MODULE_DEVICE_TABLE() are not generating the proper module aliases. Add the needed entry here.

---
 scripts/mod/devicetable-offsets.c |  3 +++
 scripts/mod/file2alias.c          | 11 +++++++++++
 2 files changed, 14 insertions(+)
scripts/mod/devicetable-offsets.c +0 -0
index 9fad6afe4c41..6667f7b491d6 100644

scripts/mod/devicetable-offsets.c int main(void) · line 147

Quoted 9 lines
scripts/mod/devicetable-offsets.c +3 -0
@@ -139,6 +139,9 @@ int main(void)
 	DEVID(hv_vmbus_device_id);
 	DEVID_FIELD(hv_vmbus_device_id, guid);
 
+	DEVID(rpmsg_device_id);
+	DEVID_FIELD(rpmsg_device_id, name);
+
 	DEVID(i2c_device_id);
 	DEVID_FIELD(i2c_device_id, name);
 

I don't understand, what caused this to break? Has this ever worked?

Quoted 8 lines
scripts/mod/file2alias.c +0 -0
index b9beeaa4695b..52fd54a8fe39 100644
@@ -944,6 +944,17 @@ static int do_vmbus_entry(const char *filename, void *symval,
 }
 ADD_TO_DEVTABLE("vmbus", hv_vmbus_device_id, do_vmbus_entry);
 

scripts/mod/file2alias.c static int do_vmbus_entry(const char *filename, void *symval, · line 956

Quoted 10 lines
scripts/mod/file2alias.c +10 -0
+/* Looks like: rpmsg:S */
+static int do_rpmsg_entry(const char *filename, void *symval,
+			  char *alias)
+{
+	DEF_FIELD_ADDR(symval, rpmsg_device_id, name);
+	sprintf(alias, RPMSG_DEVICE_MODALIAS_FMT, *name);
+
+	return 1;
+}
+ADD_TO_DEVTABLE("rpmsg", rpmsg_device_id, do_rpmsg_entry);

Is this just for this one specific bus type? How far back does this patch need to go? How has no one noticed this before?

thanks,

greg k-h

#2 lore raw
Quoted 19 lines · Greg Kroah-Hartman
Quoted 18 lines · Andrew F. Davis

Due to missing a missing entry in file2alias.c MODULE_DEVICE_TABLE() are not generating the proper module aliases. Add the needed entry here.

---
 scripts/mod/devicetable-offsets.c |  3 +++
 scripts/mod/file2alias.c          | 11 +++++++++++
 2 files changed, 14 insertions(+)
scripts/mod/devicetable-offsets.c +0 -0
index 9fad6afe4c41..6667f7b491d6 100644
@@ -139,6 +139,9 @@ int main(void)
 	DEVID(hv_vmbus_device_id);
 	DEVID_FIELD(hv_vmbus_device_id, guid);
 
Quoted 9 lines

scripts/mod/devicetable-offsets.c int main(void) · line 147

Quoted 6 lines
scripts/mod/devicetable-offsets.c +3 -0
+	DEVID(rpmsg_device_id);
+	DEVID_FIELD(rpmsg_device_id, name);
+
 	DEVID(i2c_device_id);
 	DEVID_FIELD(i2c_device_id, name);
 

I don't understand, what caused this to break? Has this ever worked?

I'm not sure if this ever worked.

Quoted 8 lines
Quoted 8 lines
scripts/mod/file2alias.c +0 -0
index b9beeaa4695b..52fd54a8fe39 100644
@@ -944,6 +944,17 @@ static int do_vmbus_entry(const char *filename, void *symval,
 }
 ADD_TO_DEVTABLE("vmbus", hv_vmbus_device_id, do_vmbus_entry);
 
Quoted 14 lines

scripts/mod/file2alias.c static int do_vmbus_entry(const char *filename, void *symval, · line 956

Quoted 10 lines
scripts/mod/file2alias.c +10 -0
+/* Looks like: rpmsg:S */
+static int do_rpmsg_entry(const char *filename, void *symval,
+			  char *alias)
+{
+	DEF_FIELD_ADDR(symval, rpmsg_device_id, name);
+	sprintf(alias, RPMSG_DEVICE_MODALIAS_FMT, *name);
+
+	return 1;
+}
+ADD_TO_DEVTABLE("rpmsg", rpmsg_device_id, do_rpmsg_entry);

Is this just for this one specific bus type? How far back does this patch need to go? How has no one noticed this before?

Looks like the first half was added back at the beginning of this bus, so:

Fixes bcabbccabffe ("rpmsg: add virtio-based remote processor messaging bus")

As for how this was not noticed before, the optimist in me wants to assume everyone has just been not making these drivers as modules, the pessimist wants to question how much this use this bus sees right now..

Thanks,
Andrew

Quoted 4 lines

thanks,

greg k-h