Lines Matching refs:hpdev

105 	struct i2c_board_info *brdinfo = data->hpdev.brdinfo;  in mlxreg_hotplug_device_create()
116 if (data->hpdev.nr < 0) in mlxreg_hotplug_device_create()
120 switch (data->hpdev.action) { in mlxreg_hotplug_device_create()
122 data->hpdev.adapter = i2c_get_adapter(data->hpdev.nr + in mlxreg_hotplug_device_create()
124 if (!data->hpdev.adapter) { in mlxreg_hotplug_device_create()
126 data->hpdev.nr + pdata->shift_nr); in mlxreg_hotplug_device_create()
134 client = i2c_new_client_device(data->hpdev.adapter, in mlxreg_hotplug_device_create()
138 brdinfo->type, data->hpdev.nr + in mlxreg_hotplug_device_create()
141 i2c_put_adapter(data->hpdev.adapter); in mlxreg_hotplug_device_create()
142 data->hpdev.adapter = NULL; in mlxreg_hotplug_device_create()
146 data->hpdev.client = client; in mlxreg_hotplug_device_create()
150 if (data->hpdev.brdinfo && data->hpdev.brdinfo->platform_data) in mlxreg_hotplug_device_create()
151 mlxreg_hotplug_pdata_export(data->hpdev.brdinfo->platform_data, in mlxreg_hotplug_device_create()
154 data->notifier = data->hpdev.notifier; in mlxreg_hotplug_device_create()
155 data->hpdev.pdev = platform_device_register_resndata(&priv->pdev->dev, in mlxreg_hotplug_device_create()
157 data->hpdev.nr, in mlxreg_hotplug_device_create()
160 if (IS_ERR(data->hpdev.pdev)) in mlxreg_hotplug_device_create()
161 return PTR_ERR(data->hpdev.pdev); in mlxreg_hotplug_device_create()
168 if (data->hpdev.notifier && data->hpdev.notifier->user_handler) in mlxreg_hotplug_device_create()
169 return data->hpdev.notifier->user_handler(data->hpdev.notifier->handle, kind, 1); in mlxreg_hotplug_device_create()
181 if (data->hpdev.notifier && data->hpdev.notifier->user_handler) in mlxreg_hotplug_device_destroy()
182 data->hpdev.notifier->user_handler(data->hpdev.notifier->handle, kind, 0); in mlxreg_hotplug_device_destroy()
184 switch (data->hpdev.action) { in mlxreg_hotplug_device_destroy()
186 if (data->hpdev.client) { in mlxreg_hotplug_device_destroy()
187 i2c_unregister_device(data->hpdev.client); in mlxreg_hotplug_device_destroy()
188 data->hpdev.client = NULL; in mlxreg_hotplug_device_destroy()
191 if (data->hpdev.adapter) { in mlxreg_hotplug_device_destroy()
192 i2c_put_adapter(data->hpdev.adapter); in mlxreg_hotplug_device_destroy()
193 data->hpdev.adapter = NULL; in mlxreg_hotplug_device_destroy()
197 if (data->hpdev.pdev) in mlxreg_hotplug_device_destroy()
198 platform_device_unregister(data->hpdev.pdev); in mlxreg_hotplug_device_destroy()