Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c9bbf58 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman
Browse files

staging: iio: Use kasprintf to allocate and fill trig->name

parent cb46f472
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -83,14 +83,13 @@ int adis16209_probe_trigger(struct iio_dev *indio_dev)
	struct adis16209_state *st = indio_dev->dev_data;

	st->trig = iio_allocate_trigger();
	st->trig->name = kmalloc(IIO_TRIGGER_NAME_LENGTH, GFP_KERNEL);
	st->trig->name = kasprintf(GFP_KERNEL,
				   "adis16209-dev%d",
				   indio_dev->id);
	if (!st->trig->name) {
		ret = -ENOMEM;
		goto error_free_trig;
	}
	snprintf((char *)st->trig->name,
		 IIO_TRIGGER_NAME_LENGTH,
		 "adis16209-dev%d", indio_dev->id);
	st->trig->dev.parent = &st->us->dev;
	st->trig->owner = THIS_MODULE;
	st->trig->private_data = st;
+3 −4
Original line number Diff line number Diff line
@@ -83,14 +83,13 @@ int adis16240_probe_trigger(struct iio_dev *indio_dev)
	struct adis16240_state *st = indio_dev->dev_data;

	st->trig = iio_allocate_trigger();
	st->trig->name = kmalloc(IIO_TRIGGER_NAME_LENGTH, GFP_KERNEL);
	st->trig->name = kasprintf(GFP_KERNEL,
				   "adis16240-dev%d",
				   indio_dev->id);
	if (!st->trig->name) {
		ret = -ENOMEM;
		goto error_free_trig;
	}
	snprintf((char *)st->trig->name,
		 IIO_TRIGGER_NAME_LENGTH,
		 "adis16240-dev%d", indio_dev->id);
	st->trig->dev.parent = &st->us->dev;
	st->trig->owner = THIS_MODULE;
	st->trig->private_data = st;
+4 −4
Original line number Diff line number Diff line
@@ -495,14 +495,14 @@ int lis3l02dq_probe_trigger(struct iio_dev *indio_dev)
	if (!state->trig)
		return -ENOMEM;

	state->trig->name = kmalloc(IIO_TRIGGER_NAME_LENGTH, GFP_KERNEL);
	state->trig->name = kasprintf(GFP_KERNEL,
				      "lis3l02dq-dev%d",
				      indio_dev->id);
	if (!state->trig->name) {
		ret = -ENOMEM;
		goto error_free_trig;
	}
	snprintf((char *)state->trig->name,
		 IIO_TRIGGER_NAME_LENGTH,
		 "lis3l02dq-dev%d", indio_dev->id);

	state->trig->dev.parent = &state->us->dev;
	state->trig->owner = THIS_MODULE;
	state->trig->private_data = state;
+3 −4
Original line number Diff line number Diff line
@@ -83,14 +83,13 @@ int adis16260_probe_trigger(struct iio_dev *indio_dev)
	struct adis16260_state *st = indio_dev->dev_data;

	st->trig = iio_allocate_trigger();
	st->trig->name = kmalloc(IIO_TRIGGER_NAME_LENGTH, GFP_KERNEL);
	st->trig->name = kasprintf(GFP_KERNEL,
				   "adis16260-dev%d",
				   indio_dev->id);
	if (!st->trig->name) {
		ret = -ENOMEM;
		goto error_free_trig;
	}
	snprintf((char *)st->trig->name,
		 IIO_TRIGGER_NAME_LENGTH,
		 "adis16260-dev%d", indio_dev->id);
	st->trig->dev.parent = &st->us->dev;
	st->trig->owner = THIS_MODULE;
	st->trig->private_data = st;
+3 −4
Original line number Diff line number Diff line
@@ -86,14 +86,13 @@ int adis16300_probe_trigger(struct iio_dev *indio_dev)
	struct adis16300_state *st = indio_dev->dev_data;

	st->trig = iio_allocate_trigger();
	st->trig->name = kmalloc(IIO_TRIGGER_NAME_LENGTH, GFP_KERNEL);
	st->trig->name = kasprintf(GFP_KERNEL,
				   "adis16300-dev%d",
				   indio_dev->id);
	if (!st->trig->name) {
		ret = -ENOMEM;
		goto error_free_trig;
	}
	snprintf((char *)st->trig->name,
		 IIO_TRIGGER_NAME_LENGTH,
		 "adis16300-dev%d", indio_dev->id);
	st->trig->dev.parent = &st->us->dev;
	st->trig->owner = THIS_MODULE;
	st->trig->private_data = st;
Loading