Skip to contentSkip to conversation

drivers: change struct device_driver::coredump() return type to void

PATCH RESEND In review Arend van Spriel 1 participant 2 messages Apr 8, 2018 – Apr 18, 2018 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 drivers: change struct device_driver::coredump() return type to void

Upon submitting a patch for mwifiex [1] it was discussed whether this callback function could fail. To keep things simple there is no need for the error code so the driver can do the task synchronous or not without worries. Currently the device driver core already ignores the return value so changing it to void.

[1] https://patchwork.kernel.org/patch/10231933/

---
Hi Greg,

Here is a resend of my patch that got lost. See if it makes it this time ;-)

Regards,
Arend

---
 include/linux/device.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
include/linux/device.h +4 -2
index 0059b99..4779569 100644
@@ -256,7 +256,9 @@ enum probe_type {
  *		automatically.
  * @pm:		Power management operations of the device which matched
  *		this driver.
- * @coredump:	Called through sysfs to initiate a device coredump.
+ * @coredump:	Called when sysfs entry is written to. The device driver
+ *		is expected to call the dev_coredump API resulting in a
+ *		uevent.
  * @p:		Driver core's private data, no one other than the driver
  *		core can touch this.
  *
@@ -288,7 +290,7 @@ struct device_driver {
 	const struct attribute_group **groups;
 
 	const struct dev_pm_ops *pm;
-	int (*coredump) (struct device *dev);
+	void (*coredump) (struct device *dev);
 
 	struct driver_private *p;
 };
Signature · 1 line
2.7.4
#1 lore raw
Quoted 6 lines · Arend van Spriel

Upon submitting a patch for mwifiex [1] it was discussed whether this callback function could fail. To keep things simple there is no need for the error code so the driver can do the task synchronous or not without worries. Currently the device driver core already ignores the return value so changing it to void.

Quoted 8 lines

[1] https://patchwork.kernel.org/patch/10231933/

---
Hi Greg,

Here is a resend of my patch that got lost. See if it makes it this time ;-)

Hi Greg,

Your patch-bot replied to this one and I may be overly anxious, but that's because things ran haywire in the initial submission. So is the patch in your queue for 4.17?

Regards,
Arend

Quoted 5 lines

Regards,
Arend

---
 include/linux/device.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)