Re: [PATCH V3 1/6] SLIMbus: Device management on SLIMbus

From: Mark Brown
Date: Fri Aug 14 2015 - 22:12:12 EST


On Mon, Aug 03, 2015 at 12:59:45AM -0600, Sagar Dharia wrote:

> + INIT_WORK(&sbw->wd, slim_report);
> + sbw->sb = sb;
> + sbw->report = report;
> + if (!queue_work(ctrl->wq, &sbw->wd))
> + kfree(sbw);

Should we not complain if we fail to schedule the work?

> +#define slim_device_attr_gr NULL
> +#define slim_device_uevent NULL
> +
> +static struct device_type slim_dev_type = {
> + .groups = slim_device_attr_gr,
> + .uevent = slim_device_uevent,

Why these NULL defines? Just add the struct members as definitions are
added.

> + dev_set_name(&sbdev->dev, "%s", sbdev->name);
> + mutex_lock(&ctrl->m_ctrl);
> + list_add_tail(&sbdev->dev_list, &ctrl->devs);
> + mutex_unlock(&ctrl->m_ctrl);

Doesn't the driver model list of children of the controller give you
a list of devices connected to the controller?

> + /* Can't register until after driver model init */
> + if (WARN_ON(!slimbus_type.p)) {
> + ret = -EAGAIN;
> + goto out_list;
> + }

Shouldn't the core code handle this for us?

Attachment: signature.asc
Description: Digital signature