예제 #1
0
파일: rmi_bus.c 프로젝트: 513855417/linux
static int rmi_function_match(struct device *dev, struct device_driver *drv)
{
	struct rmi_function_handler *handler = to_rmi_function_handler(drv);
	struct rmi_function *fn = to_rmi_function(dev);

	return fn->fd.function_number == handler->func;
}
예제 #2
0
파일: rmi_bus.c 프로젝트: 513855417/linux
static int rmi_function_remove(struct device *dev)
{
	struct rmi_function *fn = to_rmi_function(dev);
	struct rmi_function_handler *handler =
					to_rmi_function_handler(dev->driver);

	if (handler->remove)
		handler->remove(fn);

	return 0;
}
예제 #3
0
static int rmi_function_remove(struct device *dev)
{
	struct rmi_function_driver *fn_drv;
	struct rmi_function *fn = to_rmi_function(dev);

	fn_drv = to_rmi_function_driver(dev->driver);

	if (fn_drv->remove)
		return fn_drv->remove(fn);

	return 0;
}
예제 #4
0
static int rmi_function_probe(struct device *dev)
{
	struct rmi_function_driver *fn_drv;
	struct rmi_function *fn = to_rmi_function(dev);

	dev_dbg(dev, "%s called.\n", __func__);

	fn_drv = to_rmi_function_driver(dev->driver);

	if (fn_drv->probe)
		return fn_drv->probe(fn);

	return 0;
}
예제 #5
0
파일: rmi_bus.c 프로젝트: 513855417/linux
static int rmi_function_probe(struct device *dev)
{
	struct rmi_function *fn = to_rmi_function(dev);
	struct rmi_function_handler *handler =
					to_rmi_function_handler(dev->driver);
	int error;

	rmi_function_of_probe(fn);

	if (handler->probe) {
		error = handler->probe(fn);
		return error;
	}

	return 0;
}
예제 #6
0
static ssize_t rmi_fn_30_suppress_show(struct device *dev, struct device_attribute *attr,
                                         char *buf)
{
        struct rmi_function *fn;
        struct rmi_fn_30_data *f30;

        fn = to_rmi_function(dev);
        if (fn == NULL)
                return -ENODEV;

        f30 = fn->data;
        if (f30 == NULL)
                return -ENODEV;

        return snprintf(buf, PAGE_SIZE, "%u\n", f30->suppress);
}
예제 #7
0
static ssize_t rmi_fn_30_suppress_store(struct device *dev, struct device_attribute *attr,
                                         const char *buf, size_t count)
{
        struct rmi_function *fn;
        struct rmi_fn_30_data *f30;
        int suppress;

        fn = to_rmi_function(dev);
        if (fn == NULL)
                return -ENODEV;

        f30 = fn->data;
        if (f30 == NULL)
                return -ENODEV;

        if (sscanf(buf, "%u", &suppress) != 1)
                return -EINVAL;
        if (suppress > 1)
                return -EINVAL;

        f30->suppress = suppress;

        return count;
}
예제 #8
0
파일: rmi_bus.c 프로젝트: 513855417/linux
static void rmi_release_function(struct device *dev)
{
	struct rmi_function *fn = to_rmi_function(dev);

	kfree(fn);
}