diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-03-14 15:07:33 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-03-14 15:07:33 +0100 |
commit | b70366e5d31788650b2a5cec5cd13ea80ac7e44a (patch) | |
tree | d972ffd190111d699200448494fda333d28b2486 /drivers/input/rmi4/rmi_driver.c | |
parent | drm/gem: Add DEFINE_DRM_GEM_FOPS (diff) | |
parent | docs-rst: automatically convert Graphviz and SVG images (diff) | |
download | linux-b70366e5d31788650b2a5cec5cd13ea80ac7e44a.tar.xz linux-b70366e5d31788650b2a5cec5cd13ea80ac7e44a.zip |
Merge tag 'doc-4.11-images' of git://git.lwn.net/linux into drm-misc-next
Pointer for Markus's image conversion work.
We need this so we can merge all the pretty drm graphs for 4.12.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'drivers/input/rmi4/rmi_driver.c')
-rw-r--r-- | drivers/input/rmi4/rmi_driver.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index bf5c36e229ba..d64fc92858f2 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -265,6 +265,19 @@ static int rmi_irq_init(struct rmi_device *rmi_dev) return 0; } +struct rmi_function *rmi_find_function(struct rmi_device *rmi_dev, u8 number) +{ + struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev); + struct rmi_function *entry; + + list_for_each_entry(entry, &data->function_list, node) { + if (entry->fd.function_number == number) + return entry; + } + + return NULL; +} + static int suspend_one_function(struct rmi_function *fn) { struct rmi_function_handler *fh; @@ -364,7 +377,7 @@ static void rmi_driver_set_input_name(struct rmi_device *rmi_dev, struct input_dev *input) { struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev); - char *device_name = rmi_f01_get_product_ID(data->f01_container); + const char *device_name = rmi_f01_get_product_ID(data->f01_container); char *name; name = devm_kasprintf(&rmi_dev->dev, GFP_KERNEL, @@ -836,7 +849,7 @@ static int rmi_create_function(struct rmi_device *rmi_dev, void *ctx, const struct pdt_entry *pdt) { struct device *dev = &rmi_dev->dev; - struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev); + struct rmi_driver_data *data = dev_get_drvdata(dev); int *current_irq_count = ctx; struct rmi_function *fn; int i; @@ -1040,7 +1053,7 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) } if (data->bootloader_mode) - dev_warn(&rmi_dev->dev, "Device in bootloader mode.\n"); + dev_warn(dev, "Device in bootloader mode.\n"); data->irq_count = irq_count; data->num_of_irq_regs = (data->irq_count + 7) / 8; @@ -1049,7 +1062,7 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) data->irq_memory = devm_kzalloc(dev, size * 4, GFP_KERNEL); if (!data->irq_memory) { dev_err(dev, "Failed to allocate memory for irq masks.\n"); - return retval; + return -ENOMEM; } data->irq_status = data->irq_memory + size * 0; |