aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dsp/syslink/multicore_ipc/nameserver_remote.c
blob: b958227d40c661181eea9e67b485cb0f21d6bcd1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 *  nameserver_remote.c
 *
 *  Copyright (C) 2008-2009 Texas Instruments, Inc.
 *
 *  This package is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 *
 *  THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 *  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 *  WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 *  PURPOSE.
 */

#include <linux/types.h>
#include <linux/slab.h>

#include <nameserver_remote.h>

/* This will get data from remote name server */
int nameserver_remote_get(const struct nameserver_remote_object *handle,
				const char *instance_name, const char *name,
				void *value, u32 *value_len, void *reserved)
{
	s32 retval = 0;

	if (WARN_ON(unlikely(handle == NULL))) {
		retval = -EINVAL;
		goto exit;
	}

	if (WARN_ON(unlikely(((instance_name == NULL) || (name == NULL)
		|| (value == NULL) || (value_len == NULL))))) {
		retval = -EINVAL;
		goto exit;
	}

	retval = handle->get(handle, instance_name,
						name, value, value_len, NULL);

exit:
	if (retval < 0)
		pr_err("nameserver_remote_get failed! status = 0x%x", retval);
	return retval;
}