platform/x86: mlx-platform: Add deffered bus functionality
mlx-platform activates i2c-mux-reg, which creates buses needed by mlxreg-hotplug. If the mlxreg-hotplug probe runs before the i2c-mux-reg probe completes, it may attempt to connect a device to an adapter number that has not been created yet, and fail. Make mlx-platform driver record the highest bus number in mlxreg-hotplug platform data and defer mlxreg-hotplug probe until all the buses are created. Signed-off-by: Vadim Pasternak <vadimp@mellanox.com> [dvhart: rewrite commit message more concisely] Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
这个提交包含在:
@@ -550,6 +550,7 @@ static int mlxreg_hotplug_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct mlxreg_core_hotplug_platform_data *pdata;
|
||||
struct mlxreg_hotplug_priv_data *priv;
|
||||
struct i2c_adapter *deferred_adap;
|
||||
int err;
|
||||
|
||||
pdata = dev_get_platdata(&pdev->dev);
|
||||
@@ -558,6 +559,12 @@ static int mlxreg_hotplug_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Defer probing if the necessary adapter is not configured yet. */
|
||||
deferred_adap = i2c_get_adapter(pdata->deferred_nr);
|
||||
if (!deferred_adap)
|
||||
return -EPROBE_DEFER;
|
||||
i2c_put_adapter(deferred_adap);
|
||||
|
||||
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
在新工单中引用
屏蔽一个用户