};
int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
- enum hmc5843_ids id);
+ enum hmc5843_ids id, const char *name);
int hmc5843_common_remove(struct device *dev);
int hmc5843_common_suspend(struct device *dev);
EXPORT_SYMBOL(hmc5843_common_resume);
int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
- enum hmc5843_ids id)
+ enum hmc5843_ids id, const char *name)
{
struct hmc5843_data *data;
struct iio_dev *indio_dev;
mutex_init(&data->lock);
indio_dev->dev.parent = dev;
- indio_dev->name = dev->driver->name;
+ indio_dev->name = name;
indio_dev->info = &hmc5843_info;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = data->variant->channels;
{
return hmc5843_common_probe(&cli->dev,
devm_regmap_init_i2c(cli, &hmc5843_i2c_regmap_config),
- id->driver_data);
+ id->driver_data, id->name);
}
static int hmc5843_i2c_remove(struct i2c_client *client)
static int hmc5843_spi_probe(struct spi_device *spi)
{
int ret;
+ const struct spi_device_id *id = spi_get_device_id(spi);
spi->mode = SPI_MODE_3;
spi->max_speed_hz = 8000000;
return hmc5843_common_probe(&spi->dev,
devm_regmap_init_spi(spi, &hmc5843_spi_regmap_config),
- HMC5983_ID);
+ id->driver_data, id->name);
}
static int hmc5843_spi_remove(struct spi_device *spi)