/* Creates hid/cid(s) string needed for modalias and uevent e.g. on a device with hid:IBM0001 and cid:ACPI0001 you get: char *modalias: "acpi:IBM0001:ACPI0001"  */
static int create_modalias(struct acpi_device *acpi_dev, char *modalias, int size)
/* Creates hid/cid(s) string needed for modalias and uevent e.g. on a device with hid:IBM0001 and cid:ACPI0001 you get: char *modalias: "acpi:IBM0001:ACPI0001"  */
static int create_modalias(struct acpi_device *acpi_dev, char *modalias, int size)
{
	int len;
	int count;
	struct acpi_hardware_id *id;
	len = snprintf(modalias, size, "acpi:");
	size -= len;
	list_for_each_entry(id, &acpi_dev->pnp.ids, list) {
		count = snprintf(&modalias[len], size, "%s:", id->id);
		if (count < 0 || count >= size)
			return -EINVAL;
		len += count;
		size -= count;
	}
	modalias[len] = '\0';
	return len;
}