Browse Source

eeprom: at24: switch to using probe_new() from the i2c framework

Use the new probe() style for i2c drivers.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bartosz Golaszewski 7 years ago
parent
commit
48b6a7d1ee
1 changed files with 5 additions and 2 deletions
  1. 5 2
      drivers/misc/eeprom/at24.c

+ 5 - 2
drivers/misc/eeprom/at24.c

@@ -519,13 +519,14 @@ static unsigned int at24_get_offset_adj(u8 flags, unsigned int byte_len)
 	}
 	}
 }
 }
 
 
-static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
+static int at24_probe(struct i2c_client *client)
 {
 {
 	struct regmap_config regmap_config = { };
 	struct regmap_config regmap_config = { };
 	struct nvmem_config nvmem_config = { };
 	struct nvmem_config nvmem_config = { };
 	const struct at24_chip_data *cd = NULL;
 	const struct at24_chip_data *cd = NULL;
 	struct at24_platform_data pdata = { };
 	struct at24_platform_data pdata = { };
 	struct device *dev = &client->dev;
 	struct device *dev = &client->dev;
+	const struct i2c_device_id *id;
 	unsigned int i, num_addresses;
 	unsigned int i, num_addresses;
 	struct at24_data *at24;
 	struct at24_data *at24;
 	size_t at24_size;
 	size_t at24_size;
@@ -533,6 +534,8 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
 	u8 test_byte;
 	u8 test_byte;
 	int err;
 	int err;
 
 
+	id = i2c_match_id(at24_ids, client);
+
 	if (dev->platform_data) {
 	if (dev->platform_data) {
 		pdata = *(struct at24_platform_data *)dev->platform_data;
 		pdata = *(struct at24_platform_data *)dev->platform_data;
 	} else {
 	} else {
@@ -717,7 +720,7 @@ static struct i2c_driver at24_driver = {
 		.of_match_table = at24_of_match,
 		.of_match_table = at24_of_match,
 		.acpi_match_table = ACPI_PTR(at24_acpi_ids),
 		.acpi_match_table = ACPI_PTR(at24_acpi_ids),
 	},
 	},
-	.probe = at24_probe,
+	.probe_new = at24_probe,
 	.remove = at24_remove,
 	.remove = at24_remove,
 	.id_table = at24_ids,
 	.id_table = at24_ids,
 };
 };