Commit aa0554d3 authored by Andy Shevchenko's avatar Andy Shevchenko
Browse files

Merge tag 'ib-devres-iio-input-pinctrl-v6.15' into intel/pinctrl



There are a few Intel pin control drivers that are affected
by the devm_kmemdup_array() conversion, merge the ib-devres-iio-input-pinctrl
for making development going smoothly.

* Split devres APIs to a separate header (linux/device/devres.h)
* Move IOMEM_ERR_PTR() to err.h to avoid unneeded loops
* Introduce devm_kmemdup_array()
* Use devm_kmemdup_array() in input, IIO, and pinctrl subsystems

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parents 0eee258c 1f4c7f3b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1245,8 +1245,8 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, unsigned int *conf, int irq)
		channel_templates = xadc_us_channels;
		max_channels = ARRAY_SIZE(xadc_us_channels);
	}
	channels = devm_kmemdup(dev, channel_templates,
				sizeof(channels[0]) * max_channels, GFP_KERNEL);
	channels = devm_kmemdup_array(dev, channel_templates, max_channels,
				      sizeof(*channel_templates), GFP_KERNEL);
	if (!channels)
		return -ENOMEM;

+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
 * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
 */

#include <linux/device.h>
#include <linux/device/devres.h>
#include <linux/err.h>
#include <linux/gfp_types.h>
#include <linux/i2c.h>
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
 * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
 */

#include <linux/device.h>
#include <linux/device/devres.h>
#include <linux/err.h>
#include <linux/gfp_types.h>
#include <linux/module.h>
+2 −3
Original line number Diff line number Diff line
@@ -102,9 +102,8 @@ static int micro_key_probe(struct platform_device *pdev)

	keys->input->keycodesize = sizeof(micro_keycodes[0]);
	keys->input->keycodemax = ARRAY_SIZE(micro_keycodes);
	keys->codes = devm_kmemdup(&pdev->dev, micro_keycodes,
			   keys->input->keycodesize * keys->input->keycodemax,
			   GFP_KERNEL);
	keys->codes = devm_kmemdup_array(&pdev->dev, micro_keycodes, keys->input->keycodemax,
					 keys->input->keycodesize, GFP_KERNEL);
	if (!keys->codes)
		return -ENOMEM;

+1 −2
Original line number Diff line number Diff line
@@ -176,8 +176,7 @@ int sparse_keymap_setup(struct input_dev *dev,
	for (e = keymap; e->type != KE_END; e++)
		map_size++;

	map = devm_kmemdup(&dev->dev, keymap, map_size * sizeof(*map),
			   GFP_KERNEL);
	map = devm_kmemdup_array(&dev->dev, keymap, map_size, sizeof(*keymap), GFP_KERNEL);
	if (!map)
		return -ENOMEM;

Loading