[PATCH 3/4] Provide VIO modalias

Brian King brking at linux.vnet.ibm.com
Wed Feb 24 11:05:42 EST 2010


On 02/23/2010 06:50 AM, David Woodhouse wrote:
>> +static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
>> +			     char *buf)
>> +{
>> +	const struct vio_dev *vio_dev = to_vio_dev(dev);
>> +	struct device_node *dn;
>> +	const char *cp;
>> +
>> +	dn = dev->archdata.of_node;
>> +	if (!dn)
>> +		return -ENODEV;
>> +	cp = of_get_property(dn, "compatible", NULL);
>> +	if (!cp)
>> +		return -ENODEV;
>> +
>> +	return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp);
>> +}
>> +
>>  static struct device_attribute vio_dev_attrs[] = {
>>  	__ATTR_RO(name),
>>  	__ATTR_RO(devspec),
>> +	__ATTR_RO(modalias),
>>  	__ATTR_NULL
>>  };

You'll want to add this to vio_cmo_dev_attrs as well, as that is the
device attribute array that gets used when active memory sharing is enabled.

Thanks,

Brian

-- 
Brian King
Linux on Power Virtualization
IBM Linux Technology Center


More information about the Linuxppc-dev mailing list