mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
iio: magnetometer: hmc5843: Simplify device abstraction
The driver supports a single chip variant only. Simplify the driver by hard-coding the device properties instead of using the id_table's abstraction for a single chip type and a lookup in a table with only one entry. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
09bfa6acb1
commit
9b6229006f
|
|
@ -56,7 +56,6 @@ static int hmc5843_spi_probe(struct spi_device *spi)
|
|||
{
|
||||
int ret;
|
||||
struct regmap *regmap;
|
||||
const struct spi_device_id *id = spi_get_device_id(spi);
|
||||
|
||||
spi->mode = SPI_MODE_3;
|
||||
spi->max_speed_hz = 8000000;
|
||||
|
|
@ -69,8 +68,7 @@ static int hmc5843_spi_probe(struct spi_device *spi)
|
|||
return PTR_ERR(regmap);
|
||||
|
||||
return hmc5843_common_probe(&spi->dev,
|
||||
regmap,
|
||||
id->driver_data, id->name);
|
||||
regmap, HMC5983_ID, "hmc5983");
|
||||
}
|
||||
|
||||
static void hmc5843_spi_remove(struct spi_device *spi)
|
||||
|
|
@ -79,7 +77,7 @@ static void hmc5843_spi_remove(struct spi_device *spi)
|
|||
}
|
||||
|
||||
static const struct spi_device_id hmc5843_id[] = {
|
||||
{ "hmc5983", HMC5983_ID },
|
||||
{ .name = "hmc5983" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(spi, hmc5843_id);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user