I started by asking this question: How do I initialize the attribute group correctly for a platform driver?
And came to the conclusion that function calling device_show_int()
was doing so with the wrong function prototype.
The code problem starts by defining the struct dev_ext_attribute
structure using the DEVICE_INT_ATTR()
macro. The [struct device_attribute][1]
structure has the show
field defined as pointer to a function taking three (3) arguments:
struct device_attribute {
struct attribute attr;
ssize_t (*show)(struct device *dev, struct device_attribute *attr,
char *buf);
ssize_t (*store)(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count);
};
Yet in my call stack (please the question referenced above) the dereferenced function is being called with only two (2) arguments from drv_attr_show():
if (drv_attr->show)
ret = drv_attr->show(drv_priv->driver, buf);
This seems pretty egregious, is it a bug or have I somehow managed to screw up the kernel build? (ARM, Kernel 3.12)