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

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

staging:iio:resolver:ad2s1210 ensure iio_dev->name is set



This is needed to ensure the required name attribute is
created. Using an id table is the route most consistent
with other drivers.

Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 10e4a52b
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -760,6 +760,7 @@ static int __devinit ad2s1210_probe(struct spi_device *spi)
	indio_dev->dev.parent = &spi->dev;
	indio_dev->dev.parent = &spi->dev;
	indio_dev->info = &ad2s1210_info;
	indio_dev->info = &ad2s1210_info;
	indio_dev->modes = INDIO_DIRECT_MODE;
	indio_dev->modes = INDIO_DIRECT_MODE;
	indio_dev->name = spi_get_device_id(spi)->name;


	ret = iio_device_register(indio_dev);
	ret = iio_device_register(indio_dev);
	if (ret)
	if (ret)
@@ -791,6 +792,11 @@ static int __devexit ad2s1210_remove(struct spi_device *spi)
	return 0;
	return 0;
}
}


static const struct spi_device_id ad2s1210_id[] = {
	{ "ad2s1210" },
	{}
};

static struct spi_driver ad2s1210_driver = {
static struct spi_driver ad2s1210_driver = {
	.driver = {
	.driver = {
		.name = DRV_NAME,
		.name = DRV_NAME,
@@ -798,6 +804,7 @@ static struct spi_driver ad2s1210_driver = {
	},
	},
	.probe = ad2s1210_probe,
	.probe = ad2s1210_probe,
	.remove = __devexit_p(ad2s1210_remove),
	.remove = __devexit_p(ad2s1210_remove),
	.id_table = ad2s1210_id,
};
};


static __init int ad2s1210_spi_init(void)
static __init int ad2s1210_spi_init(void)