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

iio: adc: nau7802: Convert driver to use ->probe_new()

Use the ->probe_new() callback.

The driver does not use const struct i2c_device_id * argument,
so convert it to utilise the simplified I²C driver registration.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220531213922.72992-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
d8600a18 3cc6a67b

+2 -8
+2 -8
drivers/iio/adc/nau7802.c
··· 407 407 .attrs = &nau7802_attribute_group, 408 408 }; 409 409 410 - static int nau7802_probe(struct i2c_client *client, 411 - const struct i2c_device_id *id) 410 + static int nau7802_probe(struct i2c_client *client) 412 411 { 413 412 struct iio_dev *indio_dev; 414 413 struct nau7802_state *st; ··· 415 416 int i, ret; 416 417 u8 data; 417 418 u32 tmp = 0; 418 - 419 - if (!client->dev.of_node) { 420 - dev_err(&client->dev, "No device tree node available.\n"); 421 - return -EINVAL; 422 - } 423 419 424 420 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*st)); 425 421 if (indio_dev == NULL) ··· 544 550 MODULE_DEVICE_TABLE(of, nau7802_dt_ids); 545 551 546 552 static struct i2c_driver nau7802_driver = { 547 - .probe = nau7802_probe, 553 + .probe_new = nau7802_probe, 548 554 .id_table = nau7802_i2c_id, 549 555 .driver = { 550 556 .name = "nau7802",