Lines Matching refs:hpdev
104 struct i2c_board_info *brdinfo = data->hpdev.brdinfo; in mlxreg_hotplug_device_create()
115 if (data->hpdev.nr < 0 && data->hpdev.action != MLXREG_HOTPLUG_DEVICE_NO_ACTION) in mlxreg_hotplug_device_create()
119 switch (data->hpdev.action) { in mlxreg_hotplug_device_create()
121 data->hpdev.adapter = i2c_get_adapter(data->hpdev.nr + in mlxreg_hotplug_device_create()
123 if (!data->hpdev.adapter) { in mlxreg_hotplug_device_create()
125 data->hpdev.nr + pdata->shift_nr); in mlxreg_hotplug_device_create()
133 client = i2c_new_client_device(data->hpdev.adapter, in mlxreg_hotplug_device_create()
137 brdinfo->type, data->hpdev.nr + in mlxreg_hotplug_device_create()
140 i2c_put_adapter(data->hpdev.adapter); in mlxreg_hotplug_device_create()
141 data->hpdev.adapter = NULL; in mlxreg_hotplug_device_create()
145 data->hpdev.client = client; in mlxreg_hotplug_device_create()
149 if (data->hpdev.brdinfo && data->hpdev.brdinfo->platform_data) in mlxreg_hotplug_device_create()
150 mlxreg_hotplug_pdata_export(data->hpdev.brdinfo->platform_data, in mlxreg_hotplug_device_create()
153 data->notifier = data->hpdev.notifier; in mlxreg_hotplug_device_create()
154 data->hpdev.pdev = platform_device_register_resndata(&priv->pdev->dev, in mlxreg_hotplug_device_create()
156 data->hpdev.nr, in mlxreg_hotplug_device_create()
159 if (IS_ERR(data->hpdev.pdev)) in mlxreg_hotplug_device_create()
160 return PTR_ERR(data->hpdev.pdev); in mlxreg_hotplug_device_create()
167 if (data->hpdev.notifier && data->hpdev.notifier->user_handler) in mlxreg_hotplug_device_create()
168 return data->hpdev.notifier->user_handler(data->hpdev.notifier->handle, kind, 1); in mlxreg_hotplug_device_create()
180 if (data->hpdev.notifier && data->hpdev.notifier->user_handler) in mlxreg_hotplug_device_destroy()
181 data->hpdev.notifier->user_handler(data->hpdev.notifier->handle, kind, 0); in mlxreg_hotplug_device_destroy()
183 switch (data->hpdev.action) { in mlxreg_hotplug_device_destroy()
185 if (data->hpdev.client) { in mlxreg_hotplug_device_destroy()
186 i2c_unregister_device(data->hpdev.client); in mlxreg_hotplug_device_destroy()
187 data->hpdev.client = NULL; in mlxreg_hotplug_device_destroy()
190 if (data->hpdev.adapter) { in mlxreg_hotplug_device_destroy()
191 i2c_put_adapter(data->hpdev.adapter); in mlxreg_hotplug_device_destroy()
192 data->hpdev.adapter = NULL; in mlxreg_hotplug_device_destroy()
196 if (data->hpdev.pdev) in mlxreg_hotplug_device_destroy()
197 platform_device_unregister(data->hpdev.pdev); in mlxreg_hotplug_device_destroy()