/* ib_set_client_data() sets client context that can be retrieved with ib_get_client_data().  */
void ib_set_client_data(struct ib_device *device, struct ib_client *client, void *data)
/* ib_set_client_data() sets client context that can be retrieved with ib_get_client_data().  */
void ib_set_client_data(struct ib_device *device, struct ib_client *client, void *data)
{
	struct ib_client_data *context;
	unsigned long flags;
	spin_lock_irqsave(&device->client_data_lock, flags);
	list_for_each_entry(context, &device->client_data_list, list)
		if (context->client == client) {
			context->data = data;
			goto out;
		}
	printk(KERN_WARNING "No client context found for %s/%s\n",
	       device->name, client->name);
out:
	spin_unlock_irqrestore(&device->client_data_lock, flags);
}