Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'staging-4.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull IIO driver fixes from Grek KH:
"It's really just IIO drivers here, some small fixes that resolve some
'crash on boot' errors that have shown up in the -rc series, and other
bugfixes that are required.

All have been in linux-next with no reported problems"

* tag 'staging-4.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
iio: imu: mpu6050: Fix name/chip_id when using ACPI
iio: imu: mpu6050: fix possible NULL dereferences
iio:adc:at91-sama5d2: Repair crash on module removal
iio: ak8975: fix maybe-uninitialized warning
iio: ak8975: Fix NULL pointer exception on early interrupt

+34 -7
+2
drivers/iio/adc/at91-sama5d2_adc.c
··· 451 451 if (ret) 452 452 goto vref_disable; 453 453 454 + platform_set_drvdata(pdev, indio_dev); 455 + 454 456 ret = iio_device_register(indio_dev); 455 457 if (ret < 0) 456 458 goto per_clk_disable_unprepare;
+27 -3
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
··· 104 104 return 0; 105 105 } 106 106 107 + static const char *inv_mpu_match_acpi_device(struct device *dev, int *chip_id) 108 + { 109 + const struct acpi_device_id *id; 110 + 111 + id = acpi_match_device(dev->driver->acpi_match_table, dev); 112 + if (!id) 113 + return NULL; 114 + 115 + *chip_id = (int)id->driver_data; 116 + 117 + return dev_name(dev); 118 + } 119 + 107 120 /** 108 121 * inv_mpu_probe() - probe function. 109 122 * @client: i2c client. ··· 128 115 const struct i2c_device_id *id) 129 116 { 130 117 struct inv_mpu6050_state *st; 131 - int result; 132 - const char *name = id ? id->name : NULL; 118 + int result, chip_type; 133 119 struct regmap *regmap; 120 + const char *name; 134 121 135 122 if (!i2c_check_functionality(client->adapter, 136 123 I2C_FUNC_SMBUS_I2C_BLOCK)) 137 124 return -EOPNOTSUPP; 125 + 126 + if (id) { 127 + chip_type = (int)id->driver_data; 128 + name = id->name; 129 + } else if (ACPI_HANDLE(&client->dev)) { 130 + name = inv_mpu_match_acpi_device(&client->dev, &chip_type); 131 + if (!name) 132 + return -ENODEV; 133 + } else { 134 + return -ENOSYS; 135 + } 138 136 139 137 regmap = devm_regmap_init_i2c(client, &inv_mpu_regmap_config); 140 138 if (IS_ERR(regmap)) { ··· 155 131 } 156 132 157 133 result = inv_mpu_core_probe(regmap, client->irq, name, 158 - NULL, id->driver_data); 134 + NULL, chip_type); 159 135 if (result < 0) 160 136 return result; 161 137
+2 -1
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
··· 46 46 struct regmap *regmap; 47 47 const struct spi_device_id *id = spi_get_device_id(spi); 48 48 const char *name = id ? id->name : NULL; 49 + const int chip_type = id ? id->driver_data : 0; 49 50 50 51 regmap = devm_regmap_init_spi(spi, &inv_mpu_regmap_config); 51 52 if (IS_ERR(regmap)) { ··· 56 55 } 57 56 58 57 return inv_mpu_core_probe(regmap, spi->irq, name, 59 - inv_mpu_i2c_disable, id->driver_data); 58 + inv_mpu_i2c_disable, chip_type); 60 59 } 61 60 62 61 static int inv_mpu_remove(struct spi_device *spi)
+3 -3
drivers/iio/magnetometer/ak8975.c
··· 462 462 int rc; 463 463 int irq; 464 464 465 + init_waitqueue_head(&data->data_ready_queue); 466 + clear_bit(0, &data->flags); 465 467 if (client->irq) 466 468 irq = client->irq; 467 469 else ··· 479 477 return rc; 480 478 } 481 479 482 - init_waitqueue_head(&data->data_ready_queue); 483 - clear_bit(0, &data->flags); 484 480 data->eoc_irq = irq; 485 481 486 482 return rc; ··· 732 732 int eoc_gpio; 733 733 int err; 734 734 const char *name = NULL; 735 - enum asahi_compass_chipset chipset; 735 + enum asahi_compass_chipset chipset = AK_MAX_TYPE; 736 736 737 737 /* Grab and set up the supplied GPIO. */ 738 738 if (client->dev.platform_data)