Commit fd7b435f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

greybus: Revert "greybus: reserve host cport id 0"

This reverts commit 698d4bd3e7541a660a3c3665f0af9e787650a239 as Alex
says it is broken.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 9df94499
......@@ -170,7 +170,6 @@ struct greybus_host_device *greybus_create_hd(struct greybus_host_driver *driver
size_t buffer_size_max)
{
struct greybus_host_device *hd;
int ret;
/*
* Validate that the driver implements all of the callbacks
......@@ -201,19 +200,12 @@ struct greybus_host_device *greybus_create_hd(struct greybus_host_driver *driver
if (!hd)
return ERR_PTR(-ENOMEM);
ida_init(&hd->cport_id_map);
/* Reserve CPort id 0 */
ret = ida_simple_get(&hd->cport_id_map, 0, 1, GFP_KERNEL);
if (ret < 0) {
kfree(hd);
return ERR_PTR(ret);
}
kref_init(&hd->kref);
hd->parent = parent;
hd->driver = driver;
INIT_LIST_HEAD(&hd->interfaces);
INIT_LIST_HEAD(&hd->connections);
ida_init(&hd->cport_id_map);
hd->buffer_size_max = buffer_size_max;
return hd;
......
......@@ -198,7 +198,7 @@ static inline int is_gb_connection(const struct device *dev)
static inline bool cport_id_valid(u16 cport_id)
{
return cport_id && cport_id != CPORT_ID_BAD && cport_id <= CPORT_ID_MAX;
return cport_id != CPORT_ID_BAD && cport_id <= CPORT_ID_MAX;
}
#endif /* __KERNEL__ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment