提交 07eaf53a 编写于 作者: W Wolfram Sang 提交者: David S. Miller

igb: convert to use i2c_new_client_device()

Move away from the deprecated API and return the shiny new ERRPTR where
useful.
Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 adde5565
...@@ -198,11 +198,11 @@ int igb_sysfs_init(struct igb_adapter *adapter) ...@@ -198,11 +198,11 @@ int igb_sysfs_init(struct igb_adapter *adapter)
} }
/* init i2c_client */ /* init i2c_client */
client = i2c_new_device(&adapter->i2c_adap, &i350_sensor_info); client = i2c_new_client_device(&adapter->i2c_adap, &i350_sensor_info);
if (client == NULL) { if (IS_ERR(client)) {
dev_info(&adapter->pdev->dev, dev_info(&adapter->pdev->dev,
"Failed to create new i2c device.\n"); "Failed to create new i2c device.\n");
rc = -ENODEV; rc = PTR_ERR(client);
goto exit; goto exit;
} }
adapter->i2c_client = client; adapter->i2c_client = client;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册