]> git.baikalelectronics.ru Git - kernel.git/commitdiff
igb: convert to use i2c_new_client_device()
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 26 Mar 2020 21:09:59 +0000 (22:09 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Mar 2020 02:31:21 +0000 (19:31 -0700)
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/igb/igb_hwmon.c

index 3b83747b27009d9f7e83dff9eaf18e20764978ac..21a29a0ca7f49151042bbeb66522e85c844bc1b8 100644 (file)
@@ -198,11 +198,11 @@ int igb_sysfs_init(struct igb_adapter *adapter)
        }
 
        /* init i2c_client */
-       client = i2c_new_device(&adapter->i2c_adap, &i350_sensor_info);
-       if (client == NULL) {
+       client = i2c_new_client_device(&adapter->i2c_adap, &i350_sensor_info);
+       if (IS_ERR(client)) {
                dev_info(&adapter->pdev->dev,
                         "Failed to create new i2c device.\n");
-               rc = -ENODEV;
+               rc = PTR_ERR(client);
                goto exit;
        }
        adapter->i2c_client = client;