Skip to content

Commit

Permalink
platform/mellanox: mlxreg-hotplug: Change input for device create rou…
Browse files Browse the repository at this point in the history
…tine

Change the first input parameter in mlxreg_hotplug_device_create to the
pointer to mlxreg_hotplug private data in order to use the fields from
the private data structure.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
[dvhart: Cleaned up commit message]
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
  • Loading branch information
mellanoxbmc authored and dvhart committed Mar 23, 2018
1 parent d726f6b commit f709e1b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/platform/mellanox/mlxreg-hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct mlxreg_hotplug_priv_data {
bool after_probe;
};

static int mlxreg_hotplug_device_create(struct device *dev,
static int mlxreg_hotplug_device_create(struct mlxreg_hotplug_priv_data *priv,
struct mlxreg_core_data *data)
{
/*
Expand All @@ -105,15 +105,15 @@ static int mlxreg_hotplug_device_create(struct device *dev,

data->hpdev.adapter = i2c_get_adapter(data->hpdev.nr);
if (!data->hpdev.adapter) {
dev_err(dev, "Failed to get adapter for bus %d\n",
dev_err(priv->dev, "Failed to get adapter for bus %d\n",
data->hpdev.nr);
return -EFAULT;
}

data->hpdev.client = i2c_new_device(data->hpdev.adapter,
data->hpdev.brdinfo);
if (!data->hpdev.client) {
dev_err(dev, "Failed to create client %s at bus %d at addr 0x%02x\n",
dev_err(priv->dev, "Failed to create client %s at bus %d at addr 0x%02x\n",
data->hpdev.brdinfo->type, data->hpdev.nr,
data->hpdev.brdinfo->addr);

Expand Down Expand Up @@ -270,10 +270,10 @@ mlxreg_hotplug_work_helper(struct mlxreg_hotplug_priv_data *priv,
if (item->inversed)
mlxreg_hotplug_device_destroy(data);
else
mlxreg_hotplug_device_create(priv->dev, data);
mlxreg_hotplug_device_create(priv, data);
} else {
if (item->inversed)
mlxreg_hotplug_device_create(priv->dev, data);
mlxreg_hotplug_device_create(priv, data);
else
mlxreg_hotplug_device_destroy(data);
}
Expand Down Expand Up @@ -319,7 +319,7 @@ mlxreg_hotplug_health_work_helper(struct mlxreg_hotplug_priv_data *priv,
if (regval == MLXREG_HOTPLUG_HEALTH_MASK) {
if ((data->health_cntr++ == MLXREG_HOTPLUG_RST_CNTR) ||
!priv->after_probe) {
mlxreg_hotplug_device_create(priv->dev, data);
mlxreg_hotplug_device_create(priv, data);
data->attached = true;
}
} else {
Expand Down

0 comments on commit f709e1b

Please sign in to comment.